Implementing the runNotification Method and Callbacks
The final task for implementing a polling notification is to add the runNotification method and any callback methods. This example implements some very basic logic as previously described. It relies on the fact that the object instance is reused between runNotification calls. This may not be a good technique if the runNotification call runs for a long time or if overlapping calls occur. A more robust model would probably use a persistent store instead of an instance variable to track the current directory snapshot.