TwistedOak.Util.Lifetime 1.0.2

A small library that implements an improved version of System.Threading.CancellationToken with support for removable registrations, to allow for garbage collection in the presence of long-lived tokens, plus some related utilities.

Motivation: cancellation tokens can be the source of memory "leaks", because an unbounded number of completed operations may have registered now-pointless callbacks on a token that can't be released or cancelled. The callbacks may reference all kinds of data, preventing effective garbage collection. Using a Lifetime allows fixing these issues because callback registrations can be given lifetimes of their own.

Additional utilities: LifetimeSource, LifetimeExchanger, DisposableLifetime, Max, Min, CreateDependentSource.

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

Release Notes

Added missing implicit conversion from CancellationToken to Lifetime. Minor documentation changes.


This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.2 865 1/8/2013
1.0.1 487 12/13/2012
1.0.0 444 12/13/2012