Turns the raw byte chunks a socket reads into whole backend messages.
TCP delivers a stream, not messages: one read can hold several messages, the
end of one, or only part of a header. The message socket runs each chunk
the reader gets through frames, so the code above always sees exactly
one complete message at a time.
Turns the raw byte chunks a socket reads into whole backend messages. TCP delivers a stream, not messages: one read can hold several messages, the end of one, or only part of a header. The message socket runs each chunk the reader gets through `frames`, so the code above always sees exactly one complete message at a time.
(frames)Transducer from byte chunks (binf buffers: byte arrays on the JVM, ArrayBuffers in JS) to one binf view per complete message.
Each message is a view into the chunk it arrived in, not a copy, so chunks must not be reused after they are put. Only a message cut across chunks is copied, once, into a buffer of its own.
Transducer from byte chunks (binf buffers: byte arrays on the JVM, ArrayBuffers in JS) to one binf view per complete message. Each message is a view into the chunk it arrived in, not a copy, so chunks must not be reused after they are put. Only a message cut across chunks is copied, once, into a buffer of its own.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |