|
1 | 1 | using System.Collections.Concurrent;
|
2 | 2 | using System.Collections.Frozen;
|
3 | 3 | using System.Collections.Immutable;
|
4 |
| -using System.Reflection.Metadata; |
5 | 4 | using System.Threading.Channels;
|
6 | 5 | using HotChocolate.Configuration;
|
7 |
| -using HotChocolate.Execution; |
8 | 6 | using HotChocolate.Execution.Caching;
|
9 | 7 | using HotChocolate.Execution.Configuration;
|
10 | 8 | using HotChocolate.Execution.Errors;
|
|
20 | 18 | using Microsoft.Extensions.ObjectPool;
|
21 | 19 | using static HotChocolate.Execution.ThrowHelper;
|
22 | 20 |
|
23 |
| -[assembly: MetadataUpdateHandler(typeof(RequestExecutorResolver.ApplicationUpdateHandler))] |
24 |
| - |
25 | 21 | namespace HotChocolate.Execution;
|
26 | 22 |
|
27 | 23 | internal sealed partial class RequestExecutorResolver
|
@@ -61,10 +57,6 @@ public RequestExecutorResolver(
|
61 | 57 | ConsumeExecutorEvictionsAsync(executorEvictionChannel.Reader, _cts.Token).FireAndForget();
|
62 | 58 |
|
63 | 59 | _optionsMonitor.OnChange(EvictRequestExecutor);
|
64 |
| - |
65 |
| - // we register the schema eviction for application updates when hot reload is used. |
66 |
| - // Whenever a hot reload update is triggered we will evict all executors. |
67 |
| - ApplicationUpdateHandler.RegisterForApplicationUpdate(EvictAllRequestExecutors); |
68 | 60 | }
|
69 | 61 |
|
70 | 62 | public IObservable<RequestExecutorEvent> Events => _events;
|
@@ -243,14 +235,6 @@ await CreateRequestExecutorAsync(schemaName, false, CancellationToken.None)
|
243 | 235 | }
|
244 | 236 | }
|
245 | 237 |
|
246 |
| - private void EvictAllRequestExecutors() |
247 |
| - { |
248 |
| - foreach (var key in _executors.Keys) |
249 |
| - { |
250 |
| - EvictRequestExecutor(key); |
251 |
| - } |
252 |
| - } |
253 |
| - |
254 | 238 | private static async Task RunEvictionEvents(RegisteredExecutor registeredExecutor)
|
255 | 239 | {
|
256 | 240 | try
|
@@ -777,32 +761,4 @@ private sealed class SchemaSetupInfo(
|
777 | 761 |
|
778 | 762 | public IList<RequestCoreMiddleware> Pipeline { get; } = pipeline;
|
779 | 763 | }
|
780 |
| - |
781 |
| - /// <summary> |
782 |
| - /// A helper calls that receives hot reload update events from the runtime and triggers |
783 |
| - /// reload of registered components. |
784 |
| - /// </summary> |
785 |
| - internal static class ApplicationUpdateHandler |
786 |
| - { |
787 |
| - private static readonly List<Action> _actions = []; |
788 |
| - |
789 |
| - public static void RegisterForApplicationUpdate(Action action) |
790 |
| - { |
791 |
| - lock (_actions) |
792 |
| - { |
793 |
| - _actions.Add(action); |
794 |
| - } |
795 |
| - } |
796 |
| - |
797 |
| - public static void UpdateApplication(Type[]? updatedTypes) |
798 |
| - { |
799 |
| - lock (_actions) |
800 |
| - { |
801 |
| - foreach (var action in _actions) |
802 |
| - { |
803 |
| - action(); |
804 |
| - } |
805 |
| - } |
806 |
| - } |
807 |
| - } |
808 | 764 | }
|
0 commit comments