# Cluster_Events

> This sample demonstrates the use of synchronous and asynchronous events in a cluster environment. It creates a cluster database, registers synchronous and asynchronous event handlers, then performs `_new()`, `_update()` and `_delete()` operations. (Note that the `delete` event handler can return a code other than MCO_S_OK, so the delete operation can be rejected, and that a handler for each event is called on all the cluster nodes so the operation is completed successfully only if all handlers on all nodes return MCO_S_OK).

### How to Run

> In a console window run:

>         cluster_events 2 0

> Then in a second console window run:

>         cluster_events 2 1

> But it is more instructive to run one instance in your development environment debugger, stepping through the code.

Related Topics