Exemplo n.º 1
0
        public RootHttpClient(HttpClient client, IOptions <ProcessExplorerWebClientOptions> options)
        {
            _http    = client;
            _options = options.Value;

            _http.BaseAddress = new Uri(_options.BaseUri);
            _http.Timeout     = TimeSpan.FromSeconds(_options.TimeOut);
        }
Exemplo n.º 2
0
        public SignalRClient(IOptions <ProcessExplorerWebClientOptions> options,
                             ITokenService tokenService)
        {
            _options      = options.Value;
            _tokenService = tokenService;

            //build hub
            _connection = new HubConnectionBuilder()
                          .WithUrl(_options.SocketUri, options =>
            {
                //add JWT token
                options.AccessTokenProvider = () => Task.FromResult(_tokenService.GetValidToken());
                //options.CloseTimeout
            })
                          .Build();
        }