An interface for all notification handlers. Implement it and pass an instance of the implementation to Handlers to be notified when a Realm changes.
public interface INotificationHandler
Methods| Improve this Doc View Source
Task HandleChangeAsync(IChangeDetails details)
An instance of IChangeDetails, containing detailed information about the changes that have occurred in the Realm.
An awaitable task that, upon completion, signifies that the changes have been processed.
Handlers will be invoked sequentially in the order in which they have been supplied in the Handlers.
This method will be invoked sequentially for Realms with the same path and in parallel for different Realms. This means that if the processing takes a lot of time, it will build up a queue of changes for that Realm path but will not affect notifications from other Realms.
bool ShouldHandle(string path)
The path to the Realm that has changed. It will be a path relative to the root of your server.
This method is invoked on the INotifier's worker thread, so it should return as soon as possible to avoid adversely affecting performance.
If the handler returns
false and no other handler wants to be notified about
the Realm at this path, then this method will no longer will be called for Realms
with that path. It is recommended that you always return the same value for a path
and perform any additional handling in the HandleChangeAsync(IChangeDetails) method.