/// <summary>
        /// Initializes a new instance of the <see cref="ResilientStreamingClient"/> class.
        /// </summary>
        /// <param name="tokenResponse"></param>
        /// <param name="options"></param>
        /// <param name="logger"></param>
        public ResilientStreamingClient(
            Func <AsyncExpiringLazy <AccessTokenResponse> > tokenResponse,
            IOptions <SalesforceConfiguration> options,
            ILogger <ResilientStreamingClient> logger)
        {
            _logger        = logger;
            _options       = options.Value;
            _tokenResponse = tokenResponse();

            CreateBayeuxClient();
        }
Example #2
0
        /// <summary>
        /// Constructor <see cref="StreamingClient"/> creates instance of the class.
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="authenticationClient"></param>
        /// <param name="options"></param>
        public StreamingClient(ILogger <StreamingClient> logger,
                               IAuthenticationClientProxy authenticationClient,
                               SalesforceConfiguration options)
        {
            _options = options ?? throw new ArgumentNullException(nameof(options));

            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _authenticationClient =
                authenticationClient ?? throw new ArgumentNullException(nameof(authenticationClient));

            InitBayeuxClient();
        }