File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/HotChocolate/Core/src/Fetching Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public sealed class BatchScheduler : IBatchHandler
17
17
private readonly List < Func < ValueTask > > _tasks = [ ] ;
18
18
private bool _dispatchOnSchedule ;
19
19
private readonly List < EventHandler > _listeners = [ ] ;
20
+ private bool _disposed ;
20
21
21
22
/// <inheritdoc />
22
23
public event EventHandler TaskEnqueued
@@ -219,4 +220,13 @@ private async Task DispatchOnEnqueue(Func<ValueTask> dispatch)
219
220
_semaphore . Release ( ) ;
220
221
}
221
222
}
223
+
224
+ public void Dispose ( )
225
+ {
226
+ if ( ! _disposed )
227
+ {
228
+ _semaphore . Dispose ( ) ;
229
+ _disposed = true ;
230
+ }
231
+ }
222
232
}
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ namespace HotChocolate.Fetching;
5
5
/// <summary>
6
6
/// The execution engine batch scheduler and dispatcher.
7
7
/// </summary>
8
- public interface IBatchHandler : IBatchDispatcher , IBatchScheduler ;
8
+ public interface IBatchHandler : IBatchDispatcher , IBatchScheduler , IDisposable ;
You can’t perform that action at this time.
0 commit comments