public TransactionalStorage(InMemoryRavenConfiguration configuration, Action onCommit, Action onStorageInaccessible, Action onNestedTransactionEnter, Action onNestedTransactionExit) { configuration.Container.SatisfyImportsOnce(this); if (configuration.CacheDocumentsInMemory == false) { documentCacher = new NullDocumentCacher(); } else { documentCacher = new DocumentCacher(configuration); } database = configuration.DataDirectory; this.configuration = configuration; this.onCommit = onCommit; path = database; if (Path.IsPathRooted(database) == false) { path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, database); } database = Path.Combine(path, "Data"); RecoverFromFailedCompact(database); new TransactionalStorageConfigurator(configuration, this).LimitSystemCache(); uniquePrefix = Interlocked.Increment(ref instanceCounter) + "-" + Base62Util.Base62Random(); CreateInstance(out instance, uniquePrefix + "-" + database); this.onNestedTransactionEnter = onNestedTransactionEnter; this.onNestedTransactionExit = onNestedTransactionExit; }
public ServerNotifications(string url, FileConvention convention) { id = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); this.url = url; this.convention = convention; }
public SubscriptionConnectionOptions() { ConnectionId = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); BatchOptions = new SubscriptionBatchOptions(); ClientAliveNotificationInterval = TimeSpan.FromMinutes(2); TimeToWaitBeforeConnectionRetry = TimeSpan.FromSeconds(15); Strategy = SubscriptionOpeningStrategy.OpenIfFree; }
protected RemoteChangesClientBase( string url, string apiKey, ICredentials credentials, TConventions conventions, Action onDispose) { // Precondition var api = this as TChangesApi; if (api == null) { throw new InvalidCastException(string.Format("The derived class does not implements {0}. Make sure the {0} interface is implemented by this class.", typeof(TChangesApi).Name)); } ConnectionStatusChanged = LogOnConnectionStatusChanged; id = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); this.url = url; this.credentials = new OperationCredentials(apiKey, credentials); this.onDispose = onDispose; Conventions = conventions; webSocket = new RavenClientWebSocket(); ConnectionTask = EstablishConnection() .ObserveException() .ContinueWith(task => { task.AssertNotFailed(); Task.Run(Receive); return(this as TChangesApi); }); }
public SubscriptionConnectionOptions() { ConnectionId = Interlocked.Increment(ref connectionCounter) + "/" + Base62Util.Base62Random(); BatchOptions = new SubscriptionBatchOptions(); ClientAliveNotificationInterval = TimeSpan.FromMinutes(2); }