예제 #1
0
 private void UnbindCompleted()
 {
     StageActor.Unwatch(_listener);
     if (_connectionFlowsAwaitingInitialization.Current == 0)
     {
         CompleteStage();
     }
     else
     {
         ScheduleOnce(BindShutdownTimer, _stage._bindShutdownTimeout);
     }
 }
예제 #2
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
        stageController = GetComponent <StageController>();
        dropController  = GetComponent <DropController>();

        if (!stageController || !dropController)
        {
            Debug.LogError("[StageActor] Missing components!");
        }
    }
예제 #3
0
            public override void PreStart()
            {
                _stageActor = GetStageActor(InitialReceive);
                var initialPartnerRef = _stage._initialPartnerRef;

                if (initialPartnerRef != null)
                {
                    // this will set the `partnerRef`
                    ObserveAndValidateSender(initialPartnerRef, "Illegal initialPartnerRef! This would be a bug in the SinkRef usage or impl.");
                    TryPull();
                }
                else
                {
                    // only schedule timeout timer if partnerRef has not been resolved yet (i.e. if this instance of the Actor
                    // has not been provided with a valid initialPartnerRef)
                    ScheduleOnce(SubscriptionTimeoutKey, SubscriptionTimeout.Timeout);
                }

                Log.Debug("Created SinkRef, pointing to remote Sink receiver: {0}, local worker: {1}", initialPartnerRef, Self);

                _promise.SetResult(new SourceRefImpl <TIn>(Self));
            }
예제 #4
0
            public override void PreStart()
            {
                _receiveBuffer   = new ModuloFixedSizeBuffer <TOut>(Settings.BufferCapacity);
                _requestStrategy = new WatermarkRequestStrategy(highWatermark: _receiveBuffer.Capacity);

                _stageActor = GetStageActor(InitialReceive);

                Log.Debug("[{0}] Allocated receiver: {1}", StageActorName, Self);

                var initialPartnerRef = _stage._initialPartnerRef;

                if (initialPartnerRef != null) // this will set the partnerRef
                {
                    ObserveAndValidateSender(initialPartnerRef, "<should never happen>");
                }

                _promise.SetResult(new SinkRefImpl <TOut>(Self));

                //this timer will be cancelled if we receive the handshake from the remote SinkRef
                // either created in this method and provided as self.ref as initialPartnerRef
                // or as the response to first CumulativeDemand request sent to remote SinkRef
                ScheduleOnce(SubscriptionTimeoutKey, SubscriptionTimeout.Timeout);
            }
예제 #5
0
 public override void PreStart()
 {
     _actor = GetStageActor(AwaitingShardIterator);
     _self  = _actor.Ref;
     GetShardIterator();
 }