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

Add `disposable-transient` #17

Closed jackfirth closed 7 years ago

jackfirth commented 7 years ago

Requires #16

A "transient" disposable is basically a pool of disposables where only one idle value is allowed, and that idle value has a timeout before being removed from the pool and deallocated. This is safe for lightweight pooling of values that are infrequently created (and avoids directly managing the pool), but when created are frequently reused for a short time. The http package essentially provides a transient connection for each scheme+host+port combination, creating new ones if used concurrently and keeping at most one idling with a timeout expiration. There are some per-custodian shenanigans performed by http which may require investigation and implementation of #11

jackfirth commented 7 years ago

Closing this in favor of a separate concept