src/ServiceRuntime/RoleEnvironment.php
public static function setStatus($status, \DateTime $expirationUtc)
    {
        self::_initialize();

        $currentStatus = CurrentStatus::STARTED;

        switch ($status) {
        case RoleInstanceStatus::BUSY:
            $currentStatus = CurrentStatus::BUSY;
            break;
        case RoleInstanceStatus::READY:
            $currentStatus = CurrentStatus::STARTED;
            break;
        }

        $newState = new AcquireCurrentState(
            self::$_clientId,
            self::$_currentGoalState->getIncarnation(),
            $currentStatus,
            $expirationUtc
        );

        self::$_lastState = $newState;

        self::$_runtimeClient->setCurrentState($newState);
    }
public static function setStatus($status, \DateTime $expirationUtc)
    {
        self::_initialize();

        $currentStatus = CurrentStatus::STARTED;

        switch ($status) {
        case RoleInstanceStatus::BUSY:
            $currentStatus = CurrentStatus::BUSY;
            break;
        case RoleInstanceStatus::READY:
            $currentStatus = CurrentStatus::STARTED;
            break;
        }

        $newState = new AcquireCurrentState(
            self::$_clientId,
            self::$_currentGoalState->getIncarnation(),
            $currentStatus,
            $expirationUtc
        );

        self::$_lastState = $newState;

        self::$_runtimeClient->setCurrentState($newState);
    }
public static function setStatus ( $ status , \ DateTime $ expirationUtc ) { self :: _initialize ( ) ; $ currentStatus = CurrentStatus :: STARTED ; switch ( $ status ) { case RoleInstanceStatus :: BUSY : $ currentStatus = CurrentStatus :: BUSY ; break ; case RoleInstanceStatus :: READY : $ currentStatus = CurrentStatus :: STARTED ; break ; } $ newState = new AcquireCurrentState ( self :: $ _clientId , self :: $ _currentGoalState -> getIncarnation ( ) , $ currentStatus , $ expirationUtc ) ; self :: $ _lastState = $ newState ; self :: $ _runtimeClient -> setCurrentState ( $ newState ) ; }
Sets the status of the role instance.

An instance may indicate that it is in one of two states: Ready or Busy.
If an instance's state is Ready, it is prepared to receive requests from
the load balancer. If the instance's state is Busy, it will not receive
requests from the load balancer.

@param int       $status        he new role status
@param \DateTime $expirationUtc The expiration UTC time

@static
Sets the status of the role instance .