jackfirth / racket-disposable

An experimental Racket library providing an abstraction for values associated with external resources that allows automatic resource pooling, per-thread virtual construction, and monadic composition
Apache License 2.0
7 stars 0 forks source link

Disposable buffers #76

Closed jackfirth closed 7 years ago

jackfirth commented 7 years ago

A generic buffer can be seen as a queue of actions that are completed in the background without blocking callers. When the buffer is disposed, all actions are flushed to ensure all enqueued work completes. Buffers are not intended for actions that return values to callers.

Creating a complementary package that defined buffers and exposed them with disposable would make it easy to create buffers that are automatically cleaned up during a cooperative exit with plumbers, or to create buffers that exist only for the duration of a server request handler.

jackfirth commented 7 years ago

Not going to implement this any time soon. Closing as archived for future work, possibly might be useful when dealing with job queues or non-request-blocking extra work completed by server actions.