Example #1
0
        public void Configure()
        {
            ConfigureDefaults();

            _serviceProvider = _serviceCollection.BuildServiceProvider();

            _remoteClient = _serviceProvider.GetRequiredService <RemoteStageClient>();

            _stageDirectory = _serviceProvider.GetRequiredService <IStageDirectory>();

            _serializer = _serviceProvider.GetRequiredService <ITransportSerializer>();

            _telemetry = _serviceProvider.GetRequiredService <ITelemetry>();

            _configured = true;
        }
        public RemoteActorMethodInterceptor(
            RemoteStageClient remoteClient,
            ITelemetry telemetry,
            ITransportSerializer serializer,
            IOptions <NanoServiceOptions> serviceOptions,
            TimeSpan?timeout      = null,
            Boolean fireAndForget = false
            )
        {
            _remoteClient   = remoteClient;
            _fireAndForget  = fireAndForget;
            _serializer     = serializer;
            _telemetry      = telemetry;
            _serviceOptions = serviceOptions.Value;


#if !RELEASE
            _timeout = timeout ?? TimeSpan.FromMilliseconds(-1);
#else
            _timeout = timeout ?? TimeSpan.FromSeconds(_serviceOptions.DefaultProxyTimeout);
#endif
        }