SimultaneousChangingEventArgs Class
Represents the arguments for the SimultaneousChanging event, which occurs before a configuration change is applied to all role instances.
Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)
Inheritance Hierarchy
System.Object
System.EventArgs
Microsoft.WindowsAzure.ServiceRuntime.SimultaneousChangingEventArgs
Syntax
public class SimultaneousChangingEventArgs : EventArgs
public ref class SimultaneousChangingEventArgs : EventArgs
type SimultaneousChangingEventArgs =
class
inherit EventArgs
end
Public Class SimultaneousChangingEventArgs
Inherits EventArgs
Properties
Name | Description | |
---|---|---|
Changes | Gets a collection of the topology changes that are ready to be applied to the role instance. |
Methods
Name | Description | |
---|---|---|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
ToString() | (Inherited from Object.) |
Remarks
The SimultaneousChanging event and the SimultaneousChanged event are used together to identify and manage configuration changes to the service model that affects all role instances at the same time. You cannot cancel the SimultaneousChanging event and the role instances will not restart when this event is received.
You can configure your application to receive simultaneous notifications about role configuration changes by setting the value of the topologyChangeDiscovery attribute to Blast in the service definition file. When the SimultaneousChanging event is received, the role instance has to accept the change. For more information about settings in the service definition file, see Windows Azure Service Definition Schema.
The following code example shows how to use the SimultaneousChangingEventArgs object to obtain notification of simultaneous topology changes that are being made to the role:
public override bool OnStart()
{
RoleEnvironment.SimultaneousChanging +=
RoleEnvironmentSimultaneousChanging;
return base.OnStart();
}
private void RoleEnvironmentSimultaneousChanging(object sender,
SimultaneousChangingEventArgs e)
{
// Get the list of topology changes
var topologyChanges = e.Changes.OfType<SimultaneousTopologyChange>();
foreach (var change in topologyChanges)
{
if (change.RoleName.Equals(
RoleEnvironment.CurrentRoleInstance.RoleName))
{
// Code to process topology changes for the role instance
}
}
}
This event occurs after the change has been submitted, but before the changes have been applied to each running role instance.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.WindowsAzure.ServiceRuntime Namespace
Return to top