public RabbitMqModelCache(IConnectionCache connectionCache, ITaskSupervisor supervisor, ModelSettings modelSettings) { _connectionCache = connectionCache; _modelSettings = modelSettings; _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<RabbitMqModelCache>.ShortName}", CloseScope); }
public RabbitMqModelCache(IConnectionCache connectionCache, ITaskSupervisor supervisor, ModelSettings modelSettings) { _connectionCache = connectionCache; _modelSettings = modelSettings; _cacheTaskScope = supervisor.CreateScope($"{TypeMetadataCache<RabbitMqModelCache>.ShortName}", CloseScope); }
public void Init() { _session = Isolate.Fake.Instance <HttpSessionStateBase>(); _connection = Isolate.Fake.Instance <IDbConnection>(); _cache = new HttpSessionStateCache(_session); Isolate.WhenCalled(() => _session[HttpSessionStateCache.ConnectionSetting] = null).ReturnRecursiveFake(); }
public void Init() { _session = Isolate.Fake.Instance<HttpSessionStateBase>(); _connection = Isolate.Fake.Instance<IDbConnection>(); _cache = new HttpSessionStateCache(_session); Isolate.WhenCalled(() => _session[HttpSessionStateCache.ConnectionSetting] = null).ReturnRecursiveFake(); }
public RabbitMqReceiveTransport(IConnectionCache connectionCache, ReceiveSettings settings, params ExchangeBindingSettings[] exchangeBindings) { _connectionCache = connectionCache; _settings = settings; _exchangeBindings = exchangeBindings; _receiveObservers = new ReceiveObservable(); _endpointObservers = new ReceiveEndpointObservable(); }
public RabbitMqReceiveTransport(IConnectionCache connectionCache, ReceiveSettings settings, params ExchangeBindingSettings[] exchangeBindings) { _connectionCache = connectionCache; _settings = settings; _exchangeBindings = exchangeBindings; _receiveObservers = new ReceiveObservable(); _endpointObservers = new ReceiveEndpointObservable(); }
public void Init() { _cache = Isolate.Fake.Instance<IConnectionCache>(); _connection = Isolate.Fake.Instance<IDbConnection>(); Isolate.WhenCalled(() => _cache.SetConnection(_connection)).IgnoreCall(); Isolate.WhenCalled(() => _cache.GetConnection()).WillReturn(_connection); InitCache(); _config = new SqLiteConfig(); }
private IDbConnection ReturnConnectionFromCache(IConnectionCache cache) { if (cache.HasNoConnection) { cache.SetConnection(new SQLiteConnection(_connectionString)); } if (cache.GetConnection().State == ConnectionState.Closed) cache.GetConnection().Open(); return cache.GetConnection(); }
public void Init() { _cache = Isolate.Fake.Instance <IConnectionCache>(); _connection = Isolate.Fake.Instance <IDbConnection>(); Isolate.WhenCalled(() => _cache.SetConnection(_connection)).IgnoreCall(); Isolate.WhenCalled(() => _cache.GetConnection()).WillReturn(_connection); InitCache(); _config = new SqLiteConfig(); }
private IDbConnection ReturnConnectionFromCache(IConnectionCache cache) { if (cache.HasNoConnection) { cache.SetConnection(new SQLiteConnection(_connectionString)); } if (cache.GetConnection().State == ConnectionState.Closed) { cache.GetConnection().Open(); } return(cache.GetConnection()); }
public ChatServerModule(IKernel kernel) { Kernel = kernel; _config = kernel.Get <IConfig>(); _sessionCache = Kernel.Get <ISessionCache>(); _connectionCache = new ConnectionCache(_sessionCache); Kernel.Bind <IConnectionCache>().ToMethod(x => _connectionCache); Kernel.Bind <ChatServerModule>().ToMethod(x => this); _sessionCache.SessionClosed += SessionCacheOnSessionClosed; var chatApiUri = $"http://{_config.LocalIP}:{_config.LocalChatPort}/"; _webApp = WebApp.Start(chatApiUri, Configuration); Console.WriteLine($"Chat server started at {chatApiUri}"); }
public ConnectionManager( IVSGitServices vsGitServices, IConnectionCache cache, ILoginManager loginManager, IApiClientFactory apiClientFactory) { this.vsGitServices = vsGitServices; this.cache = cache; this.loginManager = loginManager; this.apiClientFactory = apiClientFactory; Connections = new ObservableCollection <IConnection>(); LoadConnectionsFromCache().Forget(); }
public void SetANewConnectionWhenConnectionCacheIsEmptyAndInMemoryDatabase() { Isolate.CleanUp(); _cache = Isolate.Fake.Instance <IConnectionCache>(); _connection = Isolate.Fake.Instance <IDbConnection>(); Isolate.WhenCalled(() => _cache.HasNoConnection).WillReturn(true); Isolate.WhenCalled(() => _cache.GetConnection()).WillReturn(_connection); Isolate.WhenCalled(() => _cache.SetConnection(_connection)).IgnoreCall(); Isolate.WhenCalled(() => _connection.ConnectionString).WillReturn(SqLiteConfig.InMemoryDbConnectionString); InitCache(); _config = new SqLiteConfig(); _config.GetConnection(); Isolate.Verify.WasCalledWithAnyArguments(() => _cache.SetConnection(_connection)); }
public ConnectionManager( IProgram program, IConnectionCache cache, IKeychain keychain, ILoginManager loginManager, IUsageTracker usageTracker) { this.program = program; this.cache = cache; this.keychain = keychain; this.loginManager = loginManager; this.usageTracker = usageTracker; loaded = new TaskCompletionSource <object>(); connections = new Lazy <ObservableCollectionEx <IConnection> >( this.CreateConnections, LazyThreadSafetyMode.ExecutionAndPublication); }
public static void MyClassInitialize(TestContext testContext) { _cache = new TestConnectionCache(); }
public ActiveMqSessionCache(IActiveMqHost host, IConnectionCache connectionCache) : base(new SessionContextFactory(connectionCache, host)) { }
public ChatHub() { _connectionCache = ChatServerModule.Kernel.Get <IConnectionCache>(); _serverModule = ChatServerModule.Kernel.Get <ChatServerModule>(); }
public ModelContextFactory(IConnectionCache connectionCache, IRabbitMqHost host) { _connectionCache = connectionCache; _host = host; }
private static IDbConnection GetConnectionFromSessionState(IConnectionCache cache) { return cache.GetConnection(); }
public RabbitMqModelCache(IConnectionCache connectionCache) { _connectionCache = connectionCache; }
public ModelContextFactory(IConnectionCache connectionCache, IAmazonSqsHost host) { _connectionCache = connectionCache; _host = host; }
public RabbitMqModelCache(IConnectionCache connectionCache) { _connectionCache = connectionCache; }
public void SetANewConnectionWhenConnectionCacheIsEmptyAndInMemoryDatabase() { Isolate.CleanUp(); _cache = Isolate.Fake.Instance<IConnectionCache>(); _connection = Isolate.Fake.Instance<IDbConnection>(); Isolate.WhenCalled(() => _cache.HasNoConnection).WillReturn(true); Isolate.WhenCalled(() => _cache.GetConnection()).WillReturn(_connection); Isolate.WhenCalled(() => _cache.SetConnection(_connection)).IgnoreCall(); Isolate.WhenCalled(() => _connection.ConnectionString).WillReturn(SqLiteConfig.InMemoryDbConnectionString); InitCache(); _config = new SqLiteConfig(); _config.GetConnection(); Isolate.Verify.WasCalledWithAnyArguments(() => _cache.SetConnection(_connection)); }
private static IDbConnection GetConnectionFromSessionState(IConnectionCache cache) { return(cache.GetConnection()); }
public static void MyClassInitialize(TestContext testContext) { _cache = new TestConnectionCache(); }
public AmazonSqsModelCache(IAmazonSqsHost host, IConnectionCache connectionCache) : base(new ModelContextFactory(connectionCache, host)) { }
public RabbitMqModelCache(IRabbitMqHost host, IConnectionCache connectionCache) : base(new ModelContextFactory(connectionCache, host)) { }
public SessionContextFactory(IConnectionCache connectionCache, IActiveMqHost host) { _connectionCache = connectionCache; _host = host; }