Skip to content

Commit

Permalink
s/block/suspend
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bast committed Aug 11, 2023
1 parent b2f72d3 commit ad86714
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class ElectrumClient(

// This channel acts as a queue for messages sent/received to/from the electrum server.
// It lets us decouple message processing from the connection state (messages will be queued while we're disconnected).
// We use a rendezvous channel, which means that writers will simply block until a read operation happens.
// We use a rendezvous channel, which means that writers will simply suspend until a read operation happens.
// When connected, a dedicated coroutine will continuously read from the mailbox, send the corresponding requests to the
// electrum server, and send the response back when it is received.
// When disconnected, callers will block until we reconnect, at which point their messages will be processed.
// When disconnected, callers will suspend until we reconnect, at which point their messages will be processed.
private val mailbox = Channel<Action>()

data class ListenJob(val job: Job, val socket: TcpSocket) {
Expand Down

0 comments on commit ad86714

Please sign in to comment.