14 references to DistributedApplicationEventSubscription
Aspire.Hosting (14)
Eventing\DistributedApplicationEventing.cs (11)
12private readonly ConcurrentDictionary<Type, List<DistributedApplicationEventSubscription>> _eventSubscriptionListLookup = new(); 13private readonly ConcurrentDictionary<DistributedApplicationEventSubscription, Type> _subscriptionEventTypeLookup = new(); 31foreach (var subscription in subscriptions.ToArray()) 58foreach (var subscription in subscriptions.ToArray()) 67foreach (var subscription in subscriptions.ToArray()) 77public DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent 79var subscription = new DistributedApplicationEventSubscription(async (@event, ct) => 91if (!_eventSubscriptionListLookup.TryAdd(typeof(T), new List<DistributedApplicationEventSubscription> { subscription })) 106public DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent 119/// <inheritdoc cref="IDistributedApplicationEventing.Unsubscribe(DistributedApplicationEventSubscription)" /> 120public void Unsubscribe(DistributedApplicationEventSubscription subscription)
Eventing\IDistributedApplicationEventing.cs (3)
19DistributedApplicationEventSubscription Subscribe<T>(Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationEvent; 28DistributedApplicationEventSubscription Subscribe<T>(IResource resource, Func<T, CancellationToken, Task> callback) where T : IDistributedApplicationResourceEvent; 34void Unsubscribe(DistributedApplicationEventSubscription subscription);