public AccountClient( string baseAddress, IHttpHandler httpHandler, Dictionary <string, string> constantHeaders, Dictionary <string, string> sessionHeaders, IAsyncRequestController asyncRequestController, EvaluationNotifications evaluationNotifications) : base(baseAddress, httpHandler, constantHeaders, sessionHeaders, asyncRequestController, evaluationNotifications) { }
public AllianceClient( string baseAddress, IHttpHandler httpHandler, Dictionary <string, string> persistentHeaders, Dictionary <string, string> sessionHeaders, IAsyncRequestController asyncRequestController, EvaluationNotifications evaluationNotifications) : base(baseAddress, httpHandler, persistentHeaders, sessionHeaders, asyncRequestController, evaluationNotifications) { }
// todo possibly pass update event so async requests are either read in and handled there or this creates another thread to poll the async queue public SUGARClient(string baseAddress, IHttpHandler httpHandler = null, bool asyncEnabled = true, Dictionary <string, string> persistentHeaders = null, Dictionary <string, string> sessionHeaders = null, int timeoutMilliseconds = 60 * 1000) { _baseAddress = baseAddress; _httpHandler = httpHandler ?? new DefaultHttpHandler(); _persistentHeaders = persistentHeaders ?? new Dictionary <string, string> { { Common.APIVersion.Key, Common.APIVersion.Version } }; _sessionHeaders = sessionHeaders ?? new Dictionary <string, string>(); if (asyncEnabled) { _asyncRequestController = new AsyncRequestController(timeoutMilliseconds, () => Session.Heartbeat()); } else { _asyncRequestController = new SyncRequestController(); } }
protected ClientBase( string baseAddress, IHttpHandler httpHandler, Dictionary <string, string> constantHeaders, Dictionary <string, string> sessionHeaders, IAsyncRequestController asyncRequestController, EvaluationNotifications evaluationNotifications) { if (!Uri.IsWellFormedUriString(baseAddress, UriKind.Absolute)) { throw new ClientException("Base address is not an absolute or valid URI"); } _baseAddress = baseAddress; _httpHandler = httpHandler; _constantHeaders = constantHeaders; _sessionHeaders = sessionHeaders; AsyncRequestController = asyncRequestController; EvaluationNotifications = evaluationNotifications; }