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" />
paket add UtilPack.ResourcePooling --version 1.0.0
#r "nuget: UtilPack.ResourcePooling, 1.0.0"
// Install UtilPack.ResourcePooling as a Cake Addin #addin nuget:?package=UtilPack.ResourcePooling&version=1.0.0 // Install UtilPack.ResourcePooling as a Cake Tool #tool nuget:?package=UtilPack.ResourcePooling&version=1.0.0
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
See NuGet package for binary distribution.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on UtilPack.ResourcePooling:
The Connection-Based Asynchronous Messaging (CBAM) Abstractions.Implementation assembly contains skeleton implementations for types in CBAM.Abstractions assembly.
The Connection-Based Asynchronous Messaging (CBAM) SQL.PostgreSQL.JSON assembly provides API to add support for json and jsonb PostgreSQL types to connections of CBAM.SQL.PostgreSQL assembly. The API is two extensions methods for ConnectionPoolObservable type in CBAM.Abstractions assembly, and PgSQLConnection type in CBAM.SQL.PostgreSQL assembly. The first extension method adds support for json and jsonb PostgreSQL types to all connections created by given pool. The second extension method adds support for those types for a single connection. Once support has been added, the values of json and jsonb PostgreSQL types can be directly acquired as JToken type of Newtonsoft.JSON assembly.
Easy-to-use async resource pool for streams operating on sockets.
This project is a bridge between UtilPack.ResourcePooling project and custom MSBuild tasks.
This package is not used by any popular GitHub repositories.
Adapting to changes done in UtilPack (IAsyncDisposable and IAsyncDisposableWithToken interfaces), and also streamlining API for this release.