コード例 #1
0
        public static async void UpdateAsync(this ActorMessageSender self)
        {
            try
            {
                while (true)
                {
                    ActorTask actorTask = await self.GetAsync();

                    if (self.IsDisposed)
                    {
                        return;
                    }

                    if (actorTask.ActorMessage == null)
                    {
                        return;
                    }

                    await self.RunTask(actorTask);
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }
コード例 #2
0
        public static async void UpdateAsync(this ActorMessageSender self)
        {
            try
            {
                long instanceId = self.InstanceId;
                while (true)
                {
                    if (self.InstanceId != instanceId)
                    {
                        return;
                    }

                    ActorTask actorTask = await self.GetAsync();

                    if (self.InstanceId != instanceId)
                    {
                        return;
                    }

                    if (actorTask.ActorMessage == null)
                    {
                        return;
                    }

                    await self.RunTask(actorTask);
                }
            }
            catch (Exception e)
            {
                Log.Error(e);
            }
        }