public async Task AsyncKeyless() { this.asyncKeylessS.Subscribe(async(x, ct) => { await Task.Delay(TimeSpan.FromSeconds(2), ct); Console.WriteLine("A:" + x.MyProperty); }); var d = this.asyncKeylessS.Subscribe(async(x, ct) => { await Task.Delay(TimeSpan.FromSeconds(1), ct); Console.WriteLine("B:" + x.MyProperty); }); await asyncKeylessP.PublishAsync(new MyMessage() { MyProperty = "tako" }); await asyncKeylessP.PublishAsync(new MyMessage() { MyProperty = "yaki" }); Console.WriteLine("here?"); d.Dispose(); await asyncKeylessP.PublishAsync(new MyMessage() { MyProperty = "kamo" }); }
public async UniTask SendAsync(MyEvent ev) { // Subscriberの購読処理が終わるまで待つ await _asyncPublisher.PublishAsync(ev); Debug.Log("イベント送信完了"); }
public async UniTask OnStateBegan(CancellationToken cancellationToken) { GenerateLevel(); await UniTask.WhenAll( _answersPublisher.PublishAsync(OwnState, _gameModel.answers, cancellationToken), _correctAnswerPublisher.PublishAsync(OwnState, _gameModel.correctAnswer, cancellationToken)); }
public UniTask PublishAsync(TKey key, TMessage message, CancellationToken cancellationToken = default) { return(publisher.PublishAsync(key, message, cancellationToken)); }
public async UniTask OnStateBegan(CancellationToken token) { await _answerResultPublisher.PublishAsync(OwnState, _gameModel.IsAnswerCorrect, token); }
public async UniTask OnStateBegan(CancellationToken token) { await _gameStatePublisher.PublishAsync(OwnState, token); }