Delegate MemberLeftCallback
Defines a callback method for notifying applications when a node leaves the cluster.
Namespace:
Assembly: Alachisoft.NCache.Client.dll
Syntax
public delegate void MemberLeftCallback(NodeInfo nodeInfo);
Parameters
Type | Name | Description |
---|---|---|
NodeInfo | nodeInfo | The information of the member that has left the cluster. It describes the member in terms of the IP Address and server port. |
Remarks
This handler is invoked every time a node leaves the cluster.
Examples
The following example demonstrates how to use the MemberLeftCallback class to notify an application when a node leaves the cluster. You could include this code in a code declaration block in the Web Forms page, or in a page code-behind file.
public void OnMemberLeft(NodeInfo nodeInfo)
{
// ...
}
protected void Application_Start(object sender, EventArgs e)
{
try
{
ICache cache = CacheManager.GetCache("myCache");
cache.NotificationService.MemberLeft += new MemberLeftCallback(this.OnMemberLeft);
}
catch(Exception ex)
{
}
}