public ChatClientNetChannel(IActorSystem<IRoomActor> rooms, ICallbacksGatewayNode callbacksNode, INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { _rooms = rooms; _callbacksNode = callbacksNode; }
public AsyncProcessingNetChannel(Func<IMessageProcessingPipeBuilder, IMessageProcessingPipeBuilder> configureProcesssingPipe, INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { _pipeBuilder = configureProcesssingPipe(new MessageProcessingPipeBuilder()); _processor = _pipeBuilder.Build(); }
public NetChannel(INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) { _onOperationSubject = new Subject <OperationContext>(); _onDisconnectedSubject = new Subject <INetChannel>(); PendingOperationsByRequestId = new ConcurrentDictionary <Guid, PendingOperation>(); TransportChannel = transportChannel; var metricContext = Metric.Context(node.InstanceName); _receivedMessagesMeter = metricContext.Meter("ReceivedMessagesMeter", Unit.Requests); _sentMessagesMeter = metricContext.Meter("SentMessagesMeter", Unit.Requests); _requestsMeter = metricContext.Meter("SentRequestsMeter", Unit.Requests); _requestsFailedMeter = metricContext.Meter("SentRequestsFailedMeter", Unit.Requests); _requestDurationTimer = metricContext.Timer("SentRequestsDurationTimer", Unit.Requests, durationUnit: TimeUnit.Milliseconds); Node = node; Logger = logger; _config = config; _bufferPool = bufferPool; MessageSerializer = serializer; IsConnected = true; transportChannel.Bind(ProcessIncomingRequest, Dispose); }
public CallbacksGatewayNode(string name, INetProvider net, ICoreEvents coreLogger, IMessageSerializer messageSerializer, INetNodeConfig config, IBufferPool bufferPool, IPEndPoint publicAddress = null) : base(name, net, coreLogger, messageSerializer, null, config, publicAddress) { ChannelFactory = (node, transport) => { var channel = new NetChannel(node, transport, messageSerializer, coreLogger, config, bufferPool); channel.OperationReceivedEvent.Subscribe(ProcessCallbackMessage); return(channel); }; }
public AzureEventHubActorSystem(ushort id, string hubName, string hubConnectionString, string blobStorageConnectionString, bool shouldProcessEvents, Func <TActor> actorFactory, INetNodeConfig config, INetNode serverNode, IMessageSerializer serializer, IAzureEventHubActorSystemEvents logger, TimeSpan checkpointEveryTimespan) { _id = id; _hubConnectionString = hubConnectionString; _blobStorageConnectionString = blobStorageConnectionString; _shouldProcessEvents = shouldProcessEvents; _actorFactory = actorFactory; _config = config; _serverNode = serverNode; _serializer = serializer; _logger = logger; _checkpointEveryTimespan = checkpointEveryTimespan; _hubName = hubName; _consumerGroup = typeof(TActor).Name; }
public NetNode(string name, INetProvider net, ICoreEvents logger, IMessageSerializer messageSerializer, Func <INetNode, ITransportChannel, TNetChannel> channelFactory, INetNodeConfig config, IPEndPoint publicAddress = null) { _config = config; _publicAddress = publicAddress; _logger = logger; InstanceName = name; Net = net; MessageSerializer = messageSerializer; ChannelFactory = channelFactory; var metricsContext = Metric.Context(name); _netChannelsConnectedMeter = metricsContext.Meter("NetChannelsConnected", Unit.Custom("Channels")); _netChannelsDisconnectedMeter = metricsContext.Meter("NetChannelsDisconnected", Unit.Custom("Channels")); _netChannelsCounter = metricsContext.Counter("NetChannelsCount", Unit.Items); _nodeUpdateTimer = metricsContext.Timer("NodeUpdateTime", Unit.None); }
static NetNode <NetChannel> CreateNode(string nodeName, int port, INetNodeConfig nodeConfig = null) { var messageSerializer = new ProtobufMessageSerializer( new Message[] { new EmptyMessage(), new TestRequestMessage(), new TestReplyMessage() }, new MessageHeader[] { new OperationHeader() }); var coreEventLogger = Substitute.For <ICoreEvents>(); var config = nodeConfig ?? new NetNodeConfig() { ConnectTimeoutSec = 1, SendTimeoutSec = 1 }; return(new NetNode <NetChannel>(nodeName, new LidgrenNetProvider( new NetPeerConfiguration("Test") { PingInterval = 0.5f, ConnectionTimeout = 1, MaximumConnections = 10, AcceptIncomingConnections = true, Port = port }, Substitute.For <ILidgrenEvents>()), coreEventLogger, messageSerializer, (node, transport) => new NetChannel(node, transport, messageSerializer, coreEventLogger, config, new WcfBufferPool()), nodeConfig ?? config)); }
public ClientNode(IEnumerable <string> servers, INetProvider net, ICoreEvents logger, IMessageSerializer messageSerializer, Action <ISimpleMessageHandlingConfigBuilder> messageHandlingConfigurator, IFiber fiber = null, INetNodeConfig config = null, IBufferPool bufferPool = null) : base("client", net, logger, messageSerializer, null, config) { _bufferPool = bufferPool ?? new WcfBufferPool(); _messageHandlingConfigurator = messageHandlingConfigurator; if (fiber == null) { _fiber = SynchronizationContext.Current == null ? new SimpleFiber() : new SimpleFiber(TaskScheduler.FromCurrentSynchronizationContext()); } else { _fiber = fiber; } _serverEndpoints.AddRange(servers.Select(EndpointHelpers.Parse)); ChannelFactory = CreatePeer; }
public ServiceFabricActorSystemNetNode(string name, Uri serviceFabricServiceUri, INetProvider net, IActorCoreEvents logger, ICoreEvents coreLogger, IMessageSerializer messageSerializer, INetNodeConfig config = null, IBufferPool bufferPool = null, IPEndPoint publicAddress = null, Func <TActor> actorFactory = null) : base(name, net, coreLogger, messageSerializer, null, config, publicAddress) { ChannelFactory = (node, transport) => { var channel = new ActorSystemNetChannel(node, transport, messageSerializer, coreLogger, config, bufferPool); //don't process messages on local actors if factory is not provided if (actorFactory != null) { channel.ProcessIncommingMessage = Process; } return(channel); }; _serviceFabricServiceUri = serviceFabricServiceUri; _actorFactory = actorFactory; _logger = logger; var servicePartitionResolver = new ServicePartitionResolver(() => new FabricClient()); _communicationClientFactory = new NetCommunicationClientFactory(this, servicePartitionResolver); }
public SFChatClientNetChannel(INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { }
public void Init(ITransportChannel channel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) { throw new NotSupportedException(); }
public MouseActorsBackendClientNetChannel(IActorSystem <ITestActor> actorSystem, INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { _actorSystem = actorSystem; }
static NetNode<NetChannel> CreateNode(string nodeName, int port, INetNodeConfig nodeConfig = null) { var messageSerializer = new ProtobufMessageSerializer( new Message[] { new EmptyMessage(), new TestRequestMessage(), new TestReplyMessage() }, new MessageHeader[] { new OperationHeader() }); var coreEventLogger = Substitute.For<ICoreEvents>(); var config = nodeConfig ?? new NetNodeConfig() {ConnectTimeoutSec = 1, SendTimeoutSec = 1}; return new NetNode<NetChannel>(nodeName, new LidgrenNetProvider( new NetPeerConfiguration("Test") { PingInterval = 0.5f, ConnectionTimeout = 1, MaximumConnections = 10, AcceptIncomingConnections = true, Port = port}, Substitute.For<ILidgrenEvents>()), coreEventLogger, messageSerializer, (node, transport) => new NetChannel(node, transport, messageSerializer, coreEventLogger, config, new WcfBufferPool()), nodeConfig ?? config); }
public AsyncProcessingNetChannel(INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { _pipeBuilder = Configure(new MessageProcessingPipeBuilder()); _processor = _pipeBuilder.Build(); }
public MouseActorsBackendClientNetChannel(IActorSystem<ITestActor> actorSystem, INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { _actorSystem = actorSystem; }
public SFChatClientNetChannel(INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { }
public ChatClientNetChannel(IActorSystem <IRoomActor> rooms, ICallbacksGatewayNode callbacksNode, INetNode node, ITransportChannel transportChannel, IMessageSerializer serializer, ICoreEvents logger, INetNodeConfig config, IBufferPool bufferPool) : base(node, transportChannel, serializer, logger, config, bufferPool) { _rooms = rooms; _callbacksNode = callbacksNode; }