public KnownMessageRoutesActor(IExternalRoutingTable externalRoutingTable,
                                IInternalRoutingTable internalRoutingTable,
                                RouterConfiguration routerConfiguration)
 {
     this.externalRoutingTable = externalRoutingTable;
     this.internalRoutingTable = internalRoutingTable;
     this.routerConfiguration = routerConfiguration;
 }
Exemple #2
0
 public void Setup()
 {
     messageTracer = new Mock<IMessageTracer>();
     loggerMock = new Mock<ILogger>();
     logger = new Logger("default");
     actorHandlersMap = new ActorHandlerMap();
     actorHostSocketFactory = new ActorHostSocketFactory();
     socketFactory = new Mock<ISocketFactory>();
     socketFactory.Setup(m => m.CreateDealerSocket()).Returns(actorHostSocketFactory.CreateSocket);
     routerConfiguration = new RouterConfiguration
                           {
                               ScaleOutAddress = new SocketEndpoint(new Uri(localhost), SocketIdentifier.CreateIdentity()),
                               RouterAddress = new SocketEndpoint(new Uri(localhost), SocketIdentifier.CreateIdentity())
                           };
 }
 public ClusterMonitorProvider(ISocketFactory socketFactory,
                               RouterConfiguration routerConfiguration,
                               IClusterMembership clusterMembership,
                               ClusterMembershipConfiguration membershipConfiguration,
                               IRendezvousCluster rendezvousCluster,
                               ILogger logger)
 {
     clusterMonitor = membershipConfiguration.RunAsStandalone
                          ? (IClusterMonitor) new LoopbackClusterMonitor()
                          : new ClusterMonitor(socketFactory,
                                               routerConfiguration,
                                               clusterMembership,
                                               membershipConfiguration,
                                               rendezvousCluster,
                                               logger);
 }
Exemple #4
0
 public ClusterMonitor(ISocketFactory socketFactory,
                       RouterConfiguration routerConfiguration,
                       IClusterMembership clusterMembership,
                       ClusterMembershipConfiguration membershipConfiguration,
                       IRendezvousCluster rendezvousCluster,
                       ILogger logger)
 {
     this.logger = logger;
     this.membershipConfiguration = membershipConfiguration;
     pingReceived = new ManualResetEventSlim(false);
     newRendezvousConfiguration = new ManualResetEventSlim(false);
     this.socketFactory = socketFactory;
     this.routerConfiguration = routerConfiguration;
     this.clusterMembership = clusterMembership;
     this.rendezvousCluster = rendezvousCluster;
     outgoingMessages = new BlockingCollection<IMessage>(new ConcurrentQueue<IMessage>());
 }
Exemple #5
0
 public MessageRouter(ISocketFactory socketFactory,
                      IInternalRoutingTable internalRoutingTable,
                      IExternalRoutingTable externalRoutingTable,
                      RouterConfiguration routerConfiguration,
                      IClusterMonitor clusterMonitor,
                      IMessageTracer messageTracer,
                      ILogger logger)
 {
     this.logger = logger;
     this.messageTracer = messageTracer;
     this.socketFactory = socketFactory;
     localSocketIdentityPromise = new TaskCompletionSource<byte[]>();
     this.internalRoutingTable = internalRoutingTable;
     this.externalRoutingTable = externalRoutingTable;
     this.clusterMonitor = clusterMonitor;
     this.routerConfiguration = routerConfiguration;
     cancellationTokenSource = new CancellationTokenSource();
 }
Exemple #6
0
 public ActorHost(ISocketFactory socketFactory,
                  IActorHandlerMap actorHandlerMap,
                  IAsyncQueue<AsyncMessageContext> asyncQueue,
                  IAsyncQueue<IActor> actorRegistrationsQueue,
                  RouterConfiguration routerConfiguration,
                  IMessageTracer messageTracer,
                  ILogger logger)
 {
     this.logger = logger;
     this.messageTracer = messageTracer;
     this.actorHandlerMap = actorHandlerMap;
     localSocketIdentityPromise = new TaskCompletionSource<byte[]>();
     this.socketFactory = socketFactory;
     this.routerConfiguration = routerConfiguration;
     this.asyncQueue = asyncQueue;
     this.actorRegistrationsQueue = actorRegistrationsQueue;
     cancellationTokenSource = new CancellationTokenSource();
 }
 public void Setup()
 {
     membershipConfiguration = new ClusterMembershipConfiguration
                               {
                                   PongSilenceBeforeRouteDeletion = TimeSpan.FromSeconds(10)
                               };
     routerConfiguration = new RouterConfiguration
                           {
                               ScaleOutAddress = new SocketEndpoint(new Uri(localhost), SocketIdentifier.CreateIdentity()),
                               RouterAddress = new SocketEndpoint(new Uri(localhost), SocketIdentifier.CreateIdentity())
                           };
     messageRouterSocketFactory = new MessageRouterSocketFactory(routerConfiguration);
     clusterMonitor = new Mock<IClusterMonitor>();
     socketFactory = new Mock<ISocketFactory>();
     socketFactory.Setup(m => m.CreateRouterSocket()).Returns(messageRouterSocketFactory.CreateSocket);
     loggerMock = new Mock<ILogger>();
     messageTracer = new Mock<IMessageTracer>();
     logger = new Logger("default");
 }
 public MessageRouterSocketFactory(RouterConfiguration config)
 {
     this.config = config;
     sockets = new ConcurrentBag<StubSocket>();
     socketWaitTimeout = TimeSpan.FromSeconds(5);
 }