你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
CallAutomationEventProcessor.WaitForEventProcessorAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
WaitForEventProcessorAsync(Func<CallAutomationEventBase,Boolean>, CancellationToken) |
等待匹配的传入事件。 CallAutomationEventBase在到达 ProcessEvent 方法时返回 。 |
WaitForEventProcessorAsync<TEvent>(String, String, CancellationToken) |
等待匹配的传入事件。 CallAutomationEventBase在到达 ProcessEvent 方法时返回 。 |
WaitForEventProcessorAsync(Func<CallAutomationEventBase,Boolean>, CancellationToken)
等待匹配的传入事件。 CallAutomationEventBase在到达 ProcessEvent 方法时返回 。
public System.Threading.Tasks.Task<Azure.Communication.CallAutomation.CallAutomationEventBase> WaitForEventProcessorAsync (Func<Azure.Communication.CallAutomation.CallAutomationEventBase,bool> predicate, System.Threading.CancellationToken cancellationToken = default);
member this.WaitForEventProcessorAsync : Func<Azure.Communication.CallAutomation.CallAutomationEventBase, bool> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Communication.CallAutomation.CallAutomationEventBase>
Public Function WaitForEventProcessorAsync (predicate As Func(Of CallAutomationEventBase, Boolean), Optional cancellationToken As CancellationToken = Nothing) As Task(Of CallAutomationEventBase)
参数
- predicate
- Func<CallAutomationEventBase,Boolean>
用于等待事件的谓词。
- cancellationToken
- CancellationToken
取消令牌可用于设置超时或取消此 WaitForEventProcessor。
返回
CallAutomationEventBase匹配事件到达后返回 。
适用于
WaitForEventProcessorAsync<TEvent>(String, String, CancellationToken)
等待匹配的传入事件。 CallAutomationEventBase在到达 ProcessEvent 方法时返回 。
public System.Threading.Tasks.Task<TEvent> WaitForEventProcessorAsync<TEvent> (string connectionId = default, string operationContext = default, System.Threading.CancellationToken cancellationToken = default) where TEvent : Azure.Communication.CallAutomation.CallAutomationEventBase;
member this.WaitForEventProcessorAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Event (requires 'Event :> Azure.Communication.CallAutomation.CallAutomationEventBase)> (requires 'Event :> Azure.Communication.CallAutomation.CallAutomationEventBase)
Public Function WaitForEventProcessorAsync(Of TEvent As CallAutomationEventBase) (Optional connectionId As String = Nothing, Optional operationContext As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TEvent)
类型参数
- TEvent
匹配的事件类型。
参数
- connectionId
- String
调用的 CallConnectionId。
- operationContext
- String
方法的 OperationContext。
- cancellationToken
- CancellationToken
取消令牌可用于设置超时或取消此 WaitForEventProcessor。
返回
Task<TEvent>
匹配事件到达后返回事件。