MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / Subscription

Method Subscription

dotnet/src/webdriver/BiDi/Subscription.cs:53–65  ·  view source on GitHub ↗
(Func<CancellationToken, ValueTask> unsubscribe, Func<TEventArgs, ValueTask> handler, Func<TEventArgs, bool>? filter = null)

Source from the content-addressed store, hash-verified

51 private readonly Func<TEventArgs, bool>? _filter;
52
53 internal Subscription(Func<CancellationToken, ValueTask> unsubscribe, Func<TEventArgs, ValueTask> handler, Func<TEventArgs, bool>? filter = null)
54 {
55 _unsubscribe = unsubscribe;
56 _handler = handler;
57 _filter = filter;
58
59 // Detach from the caller's ambient context so events dispatched over this subscription's lifetime
60 // aren't parented to whatever activity/AsyncLocal state happened to be current at subscribe time.
61 using (ExecutionContext.SuppressFlow())
62 {
63 _dispatchTask = Task.Run(DispatchEventsAsync);
64 }
65 }
66
67 void ISubscriptionSink.Deliver(string method, EventArgs args)
68 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected