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); }
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); }
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; }
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; }