port-channel

port-channel wraps a Racket input or output port as an asynchronous channel-like object.

Input port-channels run a reader thread that reads serialized Racket values from the port, deserializes complete values and publishes them on an internal async channel. The port-channel itself is a synchronizable event, so (sync pc) returns the next complete value.

Output port-channels expose port-channel-put, which queues a value immediately. A writer thread serializes and flushes queued values to the underlying output port.

Values are encoded with racket/serialize. Custom structs must be declared with serializable-struct.

S
Description
No description provided
Readme MIT 35 KiB
Languages
Racket 100%