Port implementation over racket ports.

This commit is contained in:
2026-06-08 09:50:11 +02:00
parent ab07cfcacc
commit 59b2c698ea
6 changed files with 376 additions and 1 deletions
+11 -1
View File
@@ -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`.