Freigeben über


WebPubSubHub.OnMessageReceivedAsync Method

Definition

User event method.

public virtual System.Threading.Tasks.ValueTask<Microsoft.Azure.WebPubSub.Common.UserEventResponse> OnMessageReceivedAsync(Microsoft.Azure.WebPubSub.Common.UserEventRequest request, System.Threading.CancellationToken cancellationToken);
abstract member OnMessageReceivedAsync : Microsoft.Azure.WebPubSub.Common.UserEventRequest * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Azure.WebPubSub.Common.UserEventResponse>
override this.OnMessageReceivedAsync : Microsoft.Azure.WebPubSub.Common.UserEventRequest * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Azure.WebPubSub.Common.UserEventResponse>
Public Overridable Function OnMessageReceivedAsync (request As UserEventRequest, cancellationToken As CancellationToken) As ValueTask(Of UserEventResponse)

Parameters

request
UserEventRequest

UserEventRequest to get client message request information.

cancellationToken
CancellationToken

The CancellationToken used to cancel the request.

Returns

Build a valid UserEventResponse with UserEventRequest.CreateResponse(). Throw UnauthorizedAccessException or AuthenticationException will result 401 Status401Unauthorized status with user assigned error messages. Throw other exceptions will result 500 Status500InternalServerError with user assigned error messages.

Applies to