Ejemplo n.º 1
0
 /// <summary>
 ///     Create an Unmanaged Service.
 /// </summary>
 /// <param name="builder">
 ///     An <see cref="UnmanagedBrowsingServiceBuilder" /> to initialize the unmanaged service with.
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 ///     Thrown if <paramref name="builder" /> is a null reference.
 /// </exception>
 internal UnmanagedBrowsingService(UnmanagedBrowsingServiceBuilder builder)
 {
     this._cache    = ResilientBrowsingCache.Create(builder.Cache, 5, builder.OwnCache);
     this._client   = ResilientBrowsingClient.Create(builder.Client, 5, builder.OwnClient);
     this._database = ResilientUnmanagedBrowsingDatabase.Create(builder.Database, 5, builder.OwnDatabase);
     this._disposed = false;
 }
        /// <summary>
        ///     Create a Database Manager.
        /// </summary>
        /// <param name="builder">
        ///     A <see cref="BrowsingDatabaseManagerBuilder" /> to initialize the database manager with.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        ///     Thrown if <paramref name="builder" /> is a null reference.
        /// </exception>
        internal BrowsingDatabaseManager(BrowsingDatabaseManagerBuilder builder)
        {
            Guard.ThrowIf(nameof(builder), builder).Null();

            this._client   = ResilientBrowsingClient.Create(builder.Client, 5, builder.OwnClient);
            this._database = ResilientManagedBrowsingDatabase.Create(builder.Database, 5, builder.OwnDatabase);
            this._disposed = false;
            this._synchronizationTaskCancellationTokenSource = new CancellationTokenSource();
            this._updateConstraints = builder.UpdateConstraints;
            // ...
            //
            // ...
            this._synchronizationTask = Task.Run(this.SynchronizeDatabaseAsync);
        }