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
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.
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 bydisposable-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.