Method WaitForEvent
WaitForEvent(Session, Func<Events.Event, Boolean>, Option<TimeSpan>)
Waits for a session event matching a predicate.
Declaration
public static Task<bool> WaitForEvent(this Session session, Func<Events.Event, bool> pred, Option<TimeSpan> timeout)
Parameters
Type | Name | Description |
---|---|---|
Session | session | The session. |
System.Func<Events.Event, System.Boolean> | pred | The predicate. |
LanguageExt.Option<System.TimeSpan> | timeout | The optional timeout. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if an event matching the predicate has been received. |
WaitForEvent(Session, Func<Events.Event, Boolean>)
Waits for a session event matching a predicate.
Declaration
public static Task<bool> WaitForEvent(this Session session, Func<Events.Event, bool> pred)
Parameters
Type | Name | Description |
---|---|---|
Session | session | The session. |
System.Func<Events.Event, System.Boolean> | pred | The predicate. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if an event matching the predicate has been received. |