상속: IDisposable
예제 #1
0
        internal SqlMessageBus(string connectionString, int tableCount, SqlInstaller sqlInstaller, SqlSender sqlSender, SqlReceiver sqlReceiver, IDependencyResolver dependencyResolver)
            : base(dependencyResolver)
        {
            _installer = sqlInstaller ?? new SqlInstaller(connectionString, _tableName, tableCount);
            _installer.EnsureInstalled();

            _sender   = sqlSender ?? new SqlSender(connectionString, _tableName);
            _receiver = sqlReceiver ?? new SqlReceiver(connectionString, _tableName, OnReceived);
        }
예제 #2
0
        internal SqlMessageBus(string connectionString, int tableCount, SqlInstaller sqlInstaller, SqlSender sqlSender, SqlReceiver sqlReceiver, IDependencyResolver dependencyResolver)
            : base(dependencyResolver)
        {
            _installer = sqlInstaller ?? new SqlInstaller(connectionString, _tableName, tableCount);
            _installer.EnsureInstalled();

            _sender = sqlSender ?? new SqlSender(connectionString, _tableName);
            _receiver = sqlReceiver ?? new SqlReceiver(connectionString, _tableName, OnReceived);
        }
예제 #3
0
        public SqlStream(int streamIndex, string connectionString, string tableName, Action open, Action <int, ulong, IList <Message> > onReceived, Action <Exception> onError, TraceSource traceSource, IDbProviderFactory dbProviderFactory)
        {
            _streamIndex = streamIndex;
            _trace       = traceSource;
            _tracePrefix = String.Format(CultureInfo.InvariantCulture, "Stream {0} : ", _streamIndex);

            _sender   = new SqlSender(connectionString, tableName, _trace, dbProviderFactory);
            _receiver = new SqlReceiver(connectionString, tableName,
                                        onQuery: () => open(),
                                        onReceived: (id, messages) => onReceived(_streamIndex, id, messages),
                                        onError: ex => onError(ex),
                                        traceSource: _trace,
                                        tracePrefix: _tracePrefix,
                                        dbProviderFactory: dbProviderFactory);
        }
예제 #4
0
        public SqlStream(int streamIndex, string connectionString, string tableName, Action open, Action<int, ulong, IList<Message>> onReceived, Action<Exception> onError, TraceSource traceSource, IDbProviderFactory dbProviderFactory)
        {
            _streamIndex = streamIndex;
            _trace = traceSource;
            _tracePrefix = String.Format(CultureInfo.InvariantCulture, "Stream {0} : ", _streamIndex);

            _sender = new SqlSender(connectionString, tableName, _trace, dbProviderFactory);
            _receiver = new SqlReceiver(connectionString, tableName,
                onQuery: () => open(),
                onReceived: (id, messages) => onReceived(_streamIndex, id, messages),
                onError: ex => onError(ex),
                traceSource: _trace,
                tracePrefix: _tracePrefix,
                dbProviderFactory: dbProviderFactory);
        }
예제 #5
0
        public SqlStream(int streamIndex, string connectionString, string tableName, TraceSource traceSource, IDbProviderFactory dbProviderFactory)
        {
            _streamIndex = streamIndex;
            _trace       = traceSource;
            _tracePrefix = String.Format(CultureInfo.InvariantCulture, "Stream {0} : ", _streamIndex);

            Queried  += () => { };
            Received += (_, __) => { };
            Faulted  += _ => { };

            _sender             = new SqlSender(connectionString, tableName, _trace, dbProviderFactory);
            _receiver           = new SqlReceiver(connectionString, tableName, _trace, _tracePrefix, dbProviderFactory);
            _receiver.Queried  += () => Queried();
            _receiver.Faulted  += (ex) => Faulted(ex);
            _receiver.Received += (id, messages) => Received(id, messages);
        }
예제 #6
0
        public SqlStream(int streamIndex, string connectionString, string tableName, TraceSource traceSource, IDbProviderFactory dbProviderFactory)
        {
            _streamIndex = streamIndex;
            _trace = traceSource;
            _tracePrefix = String.Format(CultureInfo.InvariantCulture, "Stream {0} : ", _streamIndex);

            Queried += () => { };
            Received += (_, __) => { };
            Faulted += _ => { };

            _sender = new SqlSender(connectionString, tableName, _trace, dbProviderFactory);
            _receiver = new SqlReceiver(connectionString, tableName, _trace, _tracePrefix, dbProviderFactory);
            _receiver.Queried += () => Queried();
            _receiver.Faulted += (ex) => Faulted(ex);
            _receiver.Received += (id, messages) => Received(id, messages);
        }