Method ListenEvents
ListenEvents(Session, Action<Events.Event>, CancellationToken)
Triggers an action in case of an event.
Declaration
public static Task ListenEvents(this Session session, Action<Events.Event> onEvent, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Session | session | The session. |
System.Action<Events.Event> | onEvent | The action to execute. |
System.Threading.CancellationToken | token | An optional cancellation token. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The listening task. |