Port implementation over racket ports.
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
# port-channel
|
||||
|
||||
Channels over ports for racket.
|
||||
`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`.
|
||||
|
||||
Reference in New Issue
Block a user