Exemplo n.º 1
0
        public static async Task <string> Stat(IActor sender)
        {
            CheckArg.Actor(sender);

            GetInstance().SendMessage((Action <IActor>)GetInstance().DoStat, sender);

            var task = await HostDirectoryActor.GetInstance()
                       .Receive(ans => { return((ans is IActor) && (sender.Equals(((IActor)ans)))); });

            return(task as string);
        }
Exemplo n.º 2
0
        private void Behavior(IActor msg)
        {
            // get number of actor in directory
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(DirectoryActor.GetDirectory().Stat());
            // get number of actor in queue list
            sb.AppendLine(ActorTask.Stat());
            // get number of actor in hostdirectory
            sb.AppendLine(HostDirectoryActor.GetInstance().GetStat());
            msg.SendMessage(sb.ToString());
            Become(new NullBehaviors());
        }
Exemplo n.º 3
0
 private void ProcessMessage(SerialObject aSerial)
 {
     // disco ?
     if ((aSerial.Data != null) && (aSerial.Data.GetType().Equals(typeof(DiscoCommand))))
     {
         // ask directory entries for server
         //actHostDirectory.Register(this);
         DirectoryActor.GetDirectory().Disco(((DiscoCommand)aSerial.Data).Sender);
     }
     else
     {
         // or send to host directory
         HostDirectoryActor.GetInstance().SendMessage(aSerial);
     }
 }
Exemplo n.º 4
0
        private void ProcessMessage(object tobeSerial)
        {
            SerialObject aSerial = tobeSerial as SerialObject;

            if (tobeSerial is DataContractObject)
            {
                aSerial = new SerialObject(((DataContractObject)tobeSerial).Data, ((DataContractObject)tobeSerial).Tag);
            }

            // disco ?
            if (aSerial.Data?.GetType().Equals(typeof(DiscoCommand)) == true)
            {
                // ask directory entries for server
                //actHostDirectory.Register(this);
                DirectoryActor.GetDirectory().Disco(((DiscoCommand)aSerial.Data).Sender);
            }
            else
            {
                // or send to host directory
                HostDirectoryActor.GetInstance().SendMessage(aSerial);
            }
        }