UtilPack.ResourcePooling 1.0.0

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.
#r "nuget: UtilPack.ResourcePooling, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// 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
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.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on UtilPack.ResourcePooling:

Package Downloads
CBAM.Abstractions.Implementation

The Connection-Based Asynchronous Messaging (CBAM) Abstractions.Implementation assembly contains skeleton implementations for types in CBAM.Abstractions assembly.

CBAM.SQL.PostgreSQL.JSON

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.

UtilPack.ResourcePooling.NetworkStream

Easy-to-use async resource pool for streams operating on sockets.

UtilPack.ResourcePooling.MSBuild

This project is a bridge between UtilPack.ResourcePooling project and custom MSBuild tasks.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 3,471 5/26/2018
1.0.0-RC6 1,311 10/18/2017
1.0.0-RC5 1,346 9/21/2017
1.0.0-RC4 753 9/21/2017
1.0.0-RC3 511 9/7/2017
1.0.0-RC2 1,035 9/4/2017
1.0.0-RC1 602 8/10/2017

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