The RavenDB client offers a push notification feature that allows you to receive messages from a server about events that occurred there.
You are able to subscribe to events for all documents or indexes as well as to indicate a particular one that you are interested in.
This mechanism lets you notify users if something has changed without the need to do any expensive polling.
Accessing Changes API
The changes subscription is accessible by a document store.
public IDatabaseChanges changes();
public IDatabaseChanges changes(String database);
Name of database to open changes API for. If null, default database configured in DocumentStore will be used.
Instance implementing IDocumentChanges interface appropriate to store type.
IDatabaseChanges has three properties that are related to the server connection:
// returns state of the connection
// the event raised if a connection state is changed
public void addConnectionStatusChanged(EventHandler<VoidArgs> handler);
public void removeConnectionStatusChanges(EventHandler<VoidArgs> handler);
In order to retrieve notifications you have to subscribe to server-side events by using one of the following methods: