sendWhenDone() private méthode

private sendWhenDone ( Actor a, Future f ) : void
a Actor
f Future
Résultat void
Exemple #1
0
        //////////////////////////////////////////////////////////////////////////
        // Implementation
        //////////////////////////////////////////////////////////////////////////

        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);
        }
Exemple #2
0
        //////////////////////////////////////////////////////////////////////////
        // Implementation
        //////////////////////////////////////////////////////////////////////////
        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;
        }