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 refresh function option to pools #70

Closed jackfirth closed 7 years ago

jackfirth commented 7 years ago

Sometimes values returned to a pool need to be "refreshed" before they can be leased out to another client. Database connections in the db package for example will have any open transactions closed automatically when returned to a connection pool. This could be supported by disposable-pool with a keyword option providing a "refresh" function, like (disposable-pool disposable-conn #:refresh close-connection-transaction). The function should be called whenever a value is returned to the pool without being deallocated.

jackfirth commented 7 years ago

Made obsolete by #95