Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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());
                }
            }
        }