public void Start() { if (includeEvents != null && includeEvents.Count() > 0) { foreach (var eventName in includeEvents) { var pollingUrl = new PollingUrl(apiKey, eventName); pollingUrl.OnNewEvent += (object sender, Events.HoistEvent hoistEvent) => { NewEvent.Invoke(this, hoistEvent); }; pollingUrl.Start(); pollingUrls.Add(pollingUrl); } } else { var pollingUrl = new PollingUrl(apiKey); pollingUrl.OnNewEvent += (object sender, Events.HoistEvent hoistEvent) => { NewEvent.Invoke(this, hoistEvent); }; pollingUrl.Start(); pollingUrls.Add(pollingUrl); } }
public void StartPollingApp(string aAppName, string aUrl, DateTime aLastModified, Action aReadyAction, Action aFailedAction) { PollingUrl pollingUrl; if (iPollingUrls.TryGetValue(aAppName, out pollingUrl)) { pollingUrl.Cancelled = true; } pollingUrl = new PollingUrl(aUrl, aLastModified, aReadyAction, aFailedAction); iPollingUrls[aAppName] = pollingUrl; iPollingOrder.Enqueue(pollingUrl); }