Skip to content

CompositeDisposable

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Progress

CompositeDisposable Class

Composite System.IDisposable that owns a fixed set of child disposables and releases them in reverse order on NexusLabs.Needlr.AgentFramework.Progress.CompositeDisposable.Dispose.

public sealed class CompositeDisposable : System.IDisposable

Inheritance System.Object 🡒 CompositeDisposable

Implements System.IDisposable

Remarks

Null entries are ignored, allowing callers to mix typed references with conditional as IDisposable casts without pre-filtering. All entries are disposed even if earlier ones throw; collected exceptions are re-thrown as a single System.AggregateException.

Used primarily by the source generator's BeginXxxAgentProgressScope emission to tie the lifetime of per-scope sinks (that implement System.IDisposable) to the returned scope handle, preventing leaks.

Constructors

CompositeDisposable(IEnumerable<IDisposable>) Constructor

Creates a composite wrapping the supplied disposables in order.

public CompositeDisposable(System.Collections.Generic.IEnumerable<System.IDisposable?> disposables);

Parameters

disposables System.Collections.Generic.IEnumerable<System.IDisposable>

CompositeDisposable(IDisposable[]) Constructor

Creates a composite wrapping the supplied disposables in order.

public CompositeDisposable(params System.IDisposable?[] disposables);

Parameters

disposables System.IDisposable[]