public EventDispatcher(GitterClient client, ILog log, IEnumerable <RobotPart> handlers) { _client = client; _log = log; _messageHandlers = new List <RobotPart>(handlers); _lock = new object(); }
public StreamClient(EngineSettings settings, IInbox inbox, HttpClient client, GitterClient gitter, ILog log) : base(log) { _client = client; _inbox = inbox; _settings = settings; _log = log; _gitter = gitter; }
public Engine(EngineSettings settings, IInbox inbox, ILog log, IEnumerable <RobotPart> handlers) : base(log) { if (string.IsNullOrWhiteSpace(settings.Token)) { throw new ArgumentException("No Gitter API key set.", nameof(settings)); } _log = log; var client = new HttpClient { Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite) }; client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", settings.Token); var gitter = new GitterClient(client); _inbox = inbox; _streamClient = new StreamClient(settings, _inbox, client, gitter, _log); _webJobShutdownListener = new WebJobShutdownListener(_log); _dispatcher = new EventDispatcher(gitter, _log, handlers); }
protected Context(GitterClient client, GitterUser bot) { GitterClient = client; Bot = bot; }