protected void Listen() { Observable .Interval(TimeSpan.FromSeconds(10)) .Select(x => HttpClient.SendAsync(HttpRequestMessage).Result.Content.ReadAsStringAsync().Result) .Select(x => JsonConvert.DeserializeObject <SlackChannelHistory>(x)) .Subscribe( x => { OnNewMessages?.Invoke(this, x.messages); }); }
protected void newMessagesArrived(IEnumerable <TwoRatChat.Model.ChatMessage> messages) { OnNewMessages?.Invoke(messages); }