public TransportSetup(IRequestRouter requestRouter, IReceiverCache receiverCache, ITopicRouter topicRouter, IPublisherCache publisherCache) { this.topicRouter = topicRouter ?? throw new ArgumentNullException(nameof(topicRouter)); this.receiverCache = receiverCache ?? throw new ArgumentNullException(nameof(receiverCache)); this.requestRouter = requestRouter ?? throw new ArgumentNullException(nameof(requestRouter)); this.publisherCache = publisherCache ?? throw new ArgumentNullException(nameof(publisherCache)); }
/// <summary> /// Initializes a new instance of <see cref="IPublisherCache"/> /// </summary> /// <param name="name">A name that can be used to identify the router as a node on a distributed network</param> /// <param name="senderCache"></param> /// <param name="monitorCache"></param> /// <param name="receiverCache"></param> /// <param name="publisherCache"></param> /// <param name="subscriberCache"></param> public Router( string name, ISenderCache senderCache, IMonitorCache monitorCache, IReceiverCache receiverCache, IPublisherCache publisherCache, ISubscriberCache subscriberCache) { if (String.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(nameof(name)); } this.senderCache = senderCache ?? throw new ArgumentNullException(nameof(senderCache)); this.monitorCache = monitorCache ?? throw new ArgumentNullException(nameof(monitorCache)); this.receiverCache = receiverCache ?? throw new ArgumentNullException(nameof(receiverCache)); this.publisherCache = publisherCache ?? throw new ArgumentNullException(nameof(publisherCache)); this.subscriberCache = subscriberCache ?? throw new ArgumentNullException(nameof(subscriberCache)); routerInfo = new RouterInfo { Name = name, Running = false, StartedTimestamp = null, StoppedTimestamp = null }; }
/// <summary> /// Initializes a new instance of <see cref="NetMQTransport"/> /// </summary> /// <param name="factory"></param> /// <param name="requestRouter"></param> /// <param name="receiverCache"></param> /// <param name="topicRouter"></param> /// <param name="publisherCache"></param> /// <returns></returns> public static NetMQTransport Create( INetMQFactory factory, IRequestRouter requestRouter, IReceiverCache receiverCache, ITopicRouter topicRouter, IPublisherCache publisherCache ) => new NetMQTransport(factory, requestRouter, receiverCache, topicRouter, publisherCache);
public void Setup() { senderCache = mockSenderCache.Object; monitorCache = mockMonitorCache.Object; receiverCache = mockReceiverCache.Object; publisherCache = mockPublisherCache.Object; subscriberCache = mockSubscriberCache.Object; }
public void Setup() { factory = mockFactory.Object; requestRouter = mockRequestRouter.Object; topicRouter = mockTopicRouter.Object; receiverCache = mockReceiverCache.Object; publisherCache = mockPublisherCache.Object; }
/// <summary> /// Initializes a new instance of <see cref="NetMQTransport"/> /// </summary> /// <param name="factory"></param> /// <param name="requestRouter"></param> /// <param name="receiverCache"></param> /// <param name="topicRouter"></param> /// <param name="publisherCache"></param> private NetMQTransport( INetMQFactory factory, IRequestRouter requestRouter, IReceiverCache receiverCache, ITopicRouter topicRouter, IPublisherCache publisherCache) { this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); Configurer = new TransportSetup <INetMQSender, INetMQReceiver, INetMQPublisher, INetMQSubscriber>(requestRouter, receiverCache, topicRouter, publisherCache); }