private void Callback(Application.InnerQueue application) { if (RequestStop) { return; } DataDefinition.CallbackContent callbackContent; var category = DataDefinition.InnerQueueCategory.Callback; while (application.TryPeek(category, out callbackContent)) { var postContent = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(callbackContent.Post), Encoding.UTF8); using (var httpClient = new HttpClient()) { httpClient.PostAsync(callbackContent.Uri, postContent); } application.TryDequeue(category); if (RequestStop) { return; } } }
protected override void Execute() { var application = new Application.InnerQueue(); Callback(application); }