다음을 통해 공유


RoleInstanceStatus Enumeration

 

Indicates the status of a role instance.

Namespace:   Microsoft.WindowsAzure.ServiceRuntime
Assembly:  Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

Syntax

public enum RoleInstanceStatus
public enum class RoleInstanceStatus
type RoleInstanceStatus
Public Enumeration RoleInstanceStatus

Members

Member name Description
Busy

Indicates that the role instance is unavailable for requests.

Ready

Indicates that the role instance is ready to accept requests.

Remarks

The RoleInstanceStatus object is returned in the Status property of the RoleInstanceStatusCheckEventArgs class.

If the status of a role instance is Ready, it is prepared to receive requests from the load balancer. If the status of a role instance is Busy, it will not receive requests from the load balancer.

The following code example shows how to check the status of the role instance:

public override bool OnStart()
{
   RoleEnvironment.StatusCheck += RoleEnvironmentStatusCheck;

   return base.OnStart();
}

private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
{
   Trace.WriteLine("The status of the role instance:" + e.Status, "Information");
}

See Also

RoleEnvironment
Microsoft.WindowsAzure.ServiceRuntime Namespace

Return to top