示例#1
0
        public ServiceQueueWriter(IMessageSerialization messageSerialization)
        {
            if (messageSerialization == null) throw new ArgumentNullException("messageSerialization");

            _messageFrameCreator = new MessageFrameCreator(messageSerialization);
            _messageSerialization = messageSerialization;
        }
示例#2
0
        public Requester(IMessageSerialization messageSerialization)
        {
            if (messageSerialization == null) throw new ArgumentNullException("messageSerialization");

            _messageSerialization = messageSerialization;
            _messageFrameCreator = new MessageFrameCreator(messageSerialization);
        }
示例#3
0
        public Publisher(IMessageSerialization messageSerialization)
        {
            if (messageSerialization == null) throw new ArgumentNullException("messageSerialization");

            _servers = new ConcurrentDictionary<RedFoxEndpoint, ISocketAccepter>();
            _broadcastSockets = new ConcurrentDictionary<ISocket, MessageQueueReceiveLoop>();
            _messageSerialization = messageSerialization;
            _messageFrameCreator = new MessageFrameCreator(messageSerialization);
        }
示例#4
0
        public Subscriber(IMessageSerialization messageSerialization)
        {
            if (messageSerialization == null)
            {
                throw new ArgumentNullException("messageSerialization");
            }

            _messageFrameCreator  = new MessageFrameCreator(messageSerialization);
            _messageSerialization = messageSerialization;
        }
示例#5
0
        public Publisher(IMessageSerialization messageSerialization)
        {
            if (messageSerialization == null)
            {
                throw new ArgumentNullException("messageSerialization");
            }

            _servers              = new ConcurrentDictionary <RedFoxEndpoint, ISocketAccepter>();
            _broadcastSockets     = new ConcurrentDictionary <ISocket, MessageQueueReceiveLoop>();
            _messageSerialization = messageSerialization;
            _messageFrameCreator  = new MessageFrameCreator(messageSerialization);
        }
示例#6
0
        public Responder(IResponderWorkerFactory responderWorkerFactory, IMessageSerialization messageSerialization, int minThreads = 1, int maxThreads = 1)
        {
            if (responderWorkerFactory == null) throw new ArgumentNullException("responderWorkerFactory");
            if (messageSerialization == null) throw new ArgumentNullException("messageSerialization");

            _responderWorkerFactory = responderWorkerFactory;
            _messageSerialization = messageSerialization;

            _disposeCancellationTokenSource = new CancellationTokenSource();
            _disposeCancellationToken = _disposeCancellationTokenSource.Token;

            _servers = new ConcurrentDictionary<RedFoxEndpoint, ISocketAccepter>();
            _clientSockets = new ConcurrentDictionary<ISocket, SenderReceiver>();
            _scheduler = new ResponderWorkerScheduler(minThreads, maxThreads);
            _scheduler.WorkerCompleted += SchedulerWorkerCompleted;

            _messageFrameCreator = new MessageFrameCreator(messageSerialization);
        }
示例#7
0
        public Responder(IResponderWorkerFactory responderWorkerFactory, IMessageSerialization messageSerialization, int minThreads = 1, int maxThreads = 1)
        {
            if (responderWorkerFactory == null)
            {
                throw new ArgumentNullException("responderWorkerFactory");
            }
            if (messageSerialization == null)
            {
                throw new ArgumentNullException("messageSerialization");
            }

            _responderWorkerFactory = responderWorkerFactory;
            _messageSerialization   = messageSerialization;

            _disposeCancellationTokenSource = new CancellationTokenSource();
            _disposeCancellationToken       = _disposeCancellationTokenSource.Token;

            _servers                    = new ConcurrentDictionary <RedFoxEndpoint, ISocketAccepter>();
            _clientSockets              = new ConcurrentDictionary <ISocket, SenderReceiver>();
            _scheduler                  = new ResponderWorkerScheduler(minThreads, maxThreads);
            _scheduler.WorkerCompleted += SchedulerWorkerCompleted;

            _messageFrameCreator = new MessageFrameCreator(messageSerialization);
        }