public PeerHandler(Fiber fiber, Scheduler scheduler, Inbox inbox, SubscriptionObserver observer) { _observer = observer; _endpointSubscriptionCache = new EndpointSubscriptionCache(fiber, scheduler, observer); inbox.Receive<InitializePeerHandler>(init => { _peerId = init.PeerId; _peerUri = init.PeerUri; }); }
public PeerHandler(Fiber fiber, Scheduler scheduler, Inbox inbox, SubscriptionObserver observer) { _observer = observer; _endpointSubscriptionCache = new EndpointSubscriptionCache(fiber, scheduler, observer); inbox.Receive <InitializePeerHandler>(init => { _peerId = init.PeerId; _peerUri = init.PeerUri; }); }
public PeerHandler(Inbox inbox, SubscriptionObserver observer, SubscriptionRepository repository) { _observer = observer; inbox.Receive<InitializePeerHandler>(init => { _peerId = init.PeerId; _peerUri = init.PeerUri; _endpointSubscriptionCache = new EndpointSubscriptionCache(observer, _peerUri, repository); }); }
public PeerHandler(Inbox inbox, SubscriptionObserver observer, SubscriptionRepository repository) { _observer = observer; inbox.Receive <InitializePeerHandler>(init => { _peerId = init.PeerId; _peerUri = init.PeerUri; _endpointSubscriptionCache = new EndpointSubscriptionCache(observer, _peerUri, repository); }); }
public void Send(AddPeerSubscription message) { EndpointSubscriptionCache subscription; if (!_endpoints.TryGetValue(message.EndpointUri, out subscription)) { subscription = new EndpointSubscriptionCache(_fiber, _scheduler, _observer); _endpoints.Add(message.EndpointUri, subscription); } if (_log.IsDebugEnabled) _log.DebugFormat("AddPeerSubscription: {0}, {1} {2}", message.MessageName, message.EndpointUri, message.SubscriptionId); subscription.Send(message); }