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
By default, disposal deallocation happens immediately and blocks. Some resources however can be freed asynchronously without changing the semantics of a program using them. For such resources, a (disposable/delay <some-disposable>) wrapper could fire off a background thread to dispose the resource when disposal is required, allowing a program to not block on resource disposal. This should be decided per-disposable rather than per-use-site, because whether or not this is safe depends on the kind of resource produced.
By default, disposal deallocation happens immediately and blocks. Some resources however can be freed asynchronously without changing the semantics of a program using them. For such resources, a
(disposable/delay <some-disposable>)
wrapper could fire off a background thread to dispose the resource when disposal is required, allowing a program to not block on resource disposal. This should be decided per-disposable rather than per-use-site, because whether or not this is safe depends on the kind of resource produced.