UtilPack.ResourcePooling 1.0.0

Library containing types which support pooling asynchronous and synchronous resources.

Install-Package UtilPack.ResourcePooling -Version 1.0.0
dotnet add package UtilPack.ResourcePooling --version 1.0.0
<PackageReference Include="UtilPack.ResourcePooling" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UtilPack.ResourcePooling --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

UtilPack.ResourcePooling

This project contains interfaces that provide API to use pooled resources in synchronous and asynchronous way.
Additionally, classes completely implementing the interfaces are also exposed.
The resource pool API is also observable, allowing registering for events when resource is created, starting to be used, returned back to pool, and closed.
While the resource pools do not clean up themselves automatically nor periodically, they provide API to invoke clean up routine whenever the user or manager of the pool so requires.

Currently, synchronous API is not there - only asynchronous is implemented.

Using API of this library most usually starts with AsyncResourcePool interface, which acts as entrypoint for asynchronous API.
It exposes one method, UseResourceAsync, which accepts callback which receives the resource and performs some asychronous actions on it.

When the type constraints for the resources are known (e.g. must implement specific interface), but the exact type of the resource is unknown at compile time, the ResourcePoolProvider interface can be used to create a resource pool.
The configuration (e.g. file on disk) can provide the assembly name and type name of type implementing ResourcePoolProvider, which can be then instantiated and used to obtain various kinds (one-time-use, caching with clean-up, etc) of resource pools.

Varuiys kinds of connection pools are acquireable via factory methods defined as extension methods for AsyncResourceFactory interface.

Distribution

See NuGet package for binary distribution.

UtilPack.ResourcePooling

This project contains interfaces that provide API to use pooled resources in synchronous and asynchronous way.
Additionally, classes completely implementing the interfaces are also exposed.
The resource pool API is also observable, allowing registering for events when resource is created, starting to be used, returned back to pool, and closed.
While the resource pools do not clean up themselves automatically nor periodically, they provide API to invoke clean up routine whenever the user or manager of the pool so requires.

Currently, synchronous API is not there - only asynchronous is implemented.

Using API of this library most usually starts with AsyncResourcePool interface, which acts as entrypoint for asynchronous API.
It exposes one method, UseResourceAsync, which accepts callback which receives the resource and performs some asychronous actions on it.

When the type constraints for the resources are known (e.g. must implement specific interface), but the exact type of the resource is unknown at compile time, the ResourcePoolProvider interface can be used to create a resource pool.
The configuration (e.g. file on disk) can provide the assembly name and type name of type implementing ResourcePoolProvider, which can be then instantiated and used to obtain various kinds (one-time-use, caching with clean-up, etc) of resource pools.

Varuiys kinds of connection pools are acquireable via factory methods defined as extension methods for AsyncResourceFactory interface.

Distribution

See NuGet package for binary distribution.

Release Notes

Adapting to changes done in UtilPack (IAsyncDisposable and IAsyncDisposableWithToken interfaces), and also streamlining API for this release.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 377 5/26/2018
1.0.0-RC6 193 10/18/2017
1.0.0-RC5 199 9/21/2017
1.0.0-RC4 202 9/21/2017
1.0.0-RC3 199 9/7/2017
1.0.0-RC2 190 9/4/2017
1.0.0-RC1 204 8/10/2017