예제 #1
0
 public InboundStreamActor(
     IInboundStreamInterest interest,
     AddressType addressType,
     IChannelReader reader,
     long probeInterval)
 {
     _interest      = interest;
     _addressType   = addressType;
     _reader        = reader;
     _probeInterval = probeInterval;
 }
예제 #2
0
    public static IInboundStream Instance(
        Stage stage,
        IInboundStreamInterest interest,
        int port,
        AddressType addressType,
        string inboundName,
        int maxMessageSize,
        long probeInterval)
    {
        var reader = new SocketChannelInboundReader(port, inboundName, maxMessageSize, stage.World.DefaultLogger);

        var inboundStream = stage.ActorFor <IInboundStream>(() => new InboundStreamActor(interest, addressType, reader, probeInterval), $"{inboundName}-inbound");

        return(inboundStream);
    }
        public void Open(Stage stage, Wire.Node.Node node, IInboundStreamInterest interest, IConfiguration configuration)
        {
            _operationalInboundStream =
                InboundStreamFactory.Instance(
                    stage,
                    interest,
                    node.OperationalAddress.Port,
                    AddressType.Op,
                    OpName,
                    Properties.Instance.OperationalBufferSize(),
                    Properties.Instance.OperationalInboundProbeInterval());

            _operationalOutboundStream =
                OperationalOutboundStreamFactory.Instance(
                    stage,
                    node,
                    new ManagedOutboundSocketChannelProvider(node, AddressType.Op, configuration),
                    new ByteBufferPool(
                        Properties.Instance.OperationalOutgoingPooledBuffers(),
                        Properties.Instance.OperationalBufferSize()));

            _applicationInboundStream =
                InboundStreamFactory.Instance(
                    stage,
                    interest,
                    node.ApplicationAddress.Port,
                    AddressType.App,
                    AppName,
                    Properties.Instance.ApplicationBufferSize(),
                    Properties.Instance.ApplicationInboundProbeInterval());

            _applicationOutboundStream =
                ApplicationOutboundStreamFactory.Instance(
                    stage,
                    new ManagedOutboundSocketChannelProvider(node, AddressType.App, configuration),
                    new ByteBufferPool(
                        Properties.Instance.ApplicationOutgoingPooledBuffers(),
                        Properties.Instance.ApplicationBufferSize()));
        }