Beispiel #1
0
        private IAsyncSubscription subscribeAsync(string subject, string reply,
                                                  EventHandler <EncodedMessageEventArgs> handler)
        {
            if (handler == null)
            {
                throw new ArgumentException("Handler cannot be null.");
            }

            EncodedHandlerWrapper echWrapper = new EncodedHandlerWrapper(this, handler);

            IAsyncSubscription s = base.subscribeAsync(subject, reply,
                                                       echWrapper.msgHandlerToEncoderHandler);

            wrappers.Add(s, echWrapper);

            return(s);
        }
Beispiel #2
0
        private IAsyncSubscription subscribeAsync(string subject, string reply,
                                                  EventHandler <EncodedMessageEventArgs> handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException("Handler cannot be null.");
            }

            if (onDeserialize == null)
            {
                throw new NATSException("IEncodedConnection.OnDeserialize must be set before subscribing.");
            }

            EncodedHandlerWrapper echWrapper = new EncodedHandlerWrapper(this, handler);

            IAsyncSubscription s = base.subscribeAsync(subject, reply,
                                                       echWrapper.msgHandlerToEncoderHandler);

            wrappers.Add(s, echWrapper);

            return(s);
        }
Beispiel #3
0
        private IAsyncSubscription subscribeAsync(string subject, string reply,
            EventHandler<EncodedMessageEventArgs> handler)
        {
            if (handler == null)
                throw new ArgumentException("Handler cannot be null.");

            EncodedHandlerWrapper echWrapper = new EncodedHandlerWrapper(this, handler);

            IAsyncSubscription s = base.subscribeAsync(subject, reply,
                echWrapper.msgHandlerToEncoderHandler);

            wrappers.Add(s, echWrapper);

            return s;
        }
Beispiel #4
0
        private IAsyncSubscription subscribeAsync(string subject, string reply,
            EventHandler<EncodedMessageEventArgs> handler)
        {
            if (handler == null)
                throw new ArgumentException("Handler cannot be null.");

            if (onDeserialize == null)
                throw new NATSException("IEncodedConnection.OnDeserialize must be set before subscribing.");

            EncodedHandlerWrapper echWrapper = new EncodedHandlerWrapper(this, handler);

            IAsyncSubscription s = base.subscribeAsync(subject, reply,
                echWrapper.msgHandlerToEncoderHandler);

            wrappers.Add(s, echWrapper);

            return s;
        }