Fan.Sys.Actor._send C# (CSharp) Méthode

_send() private méthode

private _send ( object msg, Duration dur, Future whenDone ) : Future
msg object
dur Duration
whenDone Future
Résultat Future
        private Future _send(object msg, Duration dur, Future whenDone)
        {
            // ensure immutable or safe copy
              msg = Sys.safe(msg);

              // don't deliver new messages to a stopped pool
              if (m_pool.isStopped()) throw Err.make("ActorPool is stopped").val;

              // get the future instance to manage this message's lifecycle
              Future f = new Future(msg);

              // either enqueue immediately or schedule with pool
              if (dur != null)
            m_pool.schedule(this, dur, f);
              else if (whenDone != null)
            whenDone.sendWhenDone(this, f);
              else
            f = _enqueue(f, true);

              return f;
        }