public void Add(ActorMessageInfo info) { this.queue.Enqueue(info); if (this.tcs == null) { return; } var t = this.tcs; this.tcs = null; t.SetResult(this.queue.Dequeue()); }
private async void HandleAsync() { while (true) { try { ActorMessageInfo info = await this.GetAsync(); await this.entityActorHandler.Handle(info.Session, this.Entity, info.Message); } catch (Exception e) { Log.Error(e.ToString()); } } }