コード例 #1
0
 public async Task <IAsyncEnumerable <Person> > OnTypingAsync(
     [Service] IEventTopicObserver eventTopicObserver,
     [GlobalState] string currentUserEmail,
     CancellationToken cancellationToken) =>
 await eventTopicObserver.SubscribeAsync <string, Person>(
     $"typing_to_{currentUserEmail}", cancellationToken)
 .ConfigureAwait(false);
コード例 #2
0
 public async Task <IAsyncEnumerable <Message> > OnMessageReceivedAsync(
     [GlobalState] string currentUserEmail,
     [Service] IEventTopicObserver eventTopicObserver,
     CancellationToken cancellationToken)
 {
     return(await eventTopicObserver.SubscribeAsync <string, Message>(
                currentUserEmail, cancellationToken)
            .ConfigureAwait(false));
 }
コード例 #3
0
 public async Task <IAsyncEnumerable <Person> > OnOnlineAsync(
     [Service] IEventTopicObserver eventTopicObserver,
     CancellationToken cancellationToken) =>
 await eventTopicObserver.SubscribeAsync <string, Person>(
     "online", cancellationToken)
 .ConfigureAwait(false);