@@ -9,26 +9,6 @@ internal sealed class ManagedPipeline<TNode>(IServiceScope scope, IPipeline<TNod
99 private readonly IServiceScope _scope = scope ?? throw new ArgumentNullException ( nameof ( scope ) ) ;
1010 private readonly IPipeline < TNode > _instance = pipeline ?? throw new ArgumentNullException ( nameof ( pipeline ) ) ;
1111
12- public void Dispose ( )
13- {
14- foreach ( var subscription in pipelineSubscriptions )
15- {
16- subscription . Dispose ( ) ;
17- }
18- ( _instance as IDisposable ) ? . Dispose ( ) ;
19- _scope . Dispose ( ) ;
20- }
21-
22- public async ValueTask DisposeAsync ( )
23- {
24- foreach ( var subscription in pipelineSubscriptions )
25- {
26- subscription . Dispose ( ) ;
27- }
28- await _instance . DisposeOrDisposeAsync ( ) ;
29- await _scope . DisposeOrDisposeAsync ( ) ;
30- }
31-
3212 public Guid Id => pipeline . Id ;
3313 public string ? Name
3414 {
@@ -73,4 +53,29 @@ public IPipeline<TNode> SetOutputHandler(Action<TNode> action, IEqualityComparer
7353 public IReadOnlyCollection < IPipelineNode < TNode > > Nodes => _instance . Nodes ;
7454
7555 public IObservable < PipelineTelemetry < TNode > > Telemetry => _instance . Telemetry ;
56+
57+ public override string ToString ( )
58+ {
59+ return $ "{ pipeline } (scoped)";
60+ }
61+
62+ public void Dispose ( )
63+ {
64+ foreach ( var subscription in pipelineSubscriptions )
65+ {
66+ subscription . Dispose ( ) ;
67+ }
68+ ( _instance as IDisposable ) ? . Dispose ( ) ;
69+ _scope . Dispose ( ) ;
70+ }
71+
72+ public async ValueTask DisposeAsync ( )
73+ {
74+ foreach ( var subscription in pipelineSubscriptions )
75+ {
76+ subscription . Dispose ( ) ;
77+ }
78+ await _instance . DisposeOrDisposeAsync ( ) ;
79+ await _scope . DisposeOrDisposeAsync ( ) ;
80+ }
7681}
0 commit comments