Example #1
0
        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;
                }
            }
        }
Example #2
0
        protected override void Execute()
        {
            var application = new Application.InnerQueue();

            Callback(application);
        }