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