Nito.Disposables.ReferenceCountedAsyncDisposable
Creation methods for reference counted disposables.
public static IReferenceCountedAsyncDisposable<T> Create<T>(T disposable) where T : IAsyncDisposable
Creates a new disposable that disposes disposable when all reference counts have been disposed. This method uses attached (ephemeron) reference counters.
public static IReferenceCountedAsyncDisposable<T> CreateWithNewReferenceCounter<T>(T disposable) where T : IAsyncDisposable
Creates a new disposable that disposes disposable when all reference counts have been disposed. This method creates a new reference counter to keep track of the reference counts.
public static IReferenceCountedAsyncDisposable<T> TryCreate<T>(T disposable) where T : IAsyncDisposable
Creates a new disposable that disposes disposable when all reference counts have been disposed. This method uses attached (ephemeron) reference counters.