/// <summary>Asynchronously shuts down the host instance. This method maintains the leases on all partitions currently held, and enables each
        /// host instance to shut down cleanly by invoking the method with object.</summary>
        /// <returns>A task that indicates the host instance has stopped.</returns>
        public async Task UnregisterObserversAsync()
        {
            await this.StopAsync(ChangeFeedObserverCloseReason.Shutdown);

            this.observerFactory = null;
        }
 /// <summary>Asynchronously registers the observer interface implementation with the host.
 /// This method also starts the host and enables it to start participating in the partition distribution process.</summary>
 /// <typeparam name="T">Implementation of your application-specific event observer.</typeparam>
 /// <returns>A task indicating that the <see cref="DocumentDB.ChangeFeedProcessor.ChangeFeedEventHost" /> instance has started.</returns>
 public async Task RegisterObserverAsync <T>() where T : IChangeFeedObserver, new()
 {
     this.observerFactory = new DocumentFeedObserverFactory <T>();
     await this.StartAsync();
 }