Exemple #1
0
        static void Main(string[] args)
        {
            var messages = new TextMessages();
            var repo     = new TextRepository();
            var metrics  = new TextMetrics();

            Console.WriteLine("Listening for ExchangeTextRankCalculated event, press Ctrl+C to stop...");
            messages.ConsumeMessagesInLoop(TextMessages.QueueTextSuccessMarker, TextMessages.ExchangeTextRankCalculated, (model, json) => {
                var message           = TextRankCalculatedMessage.FromJson(json);
                bool isTextSuccessful = (message.Score > minSuccessfulScore);
                messages.SendTextSuccessMarked(message.ContextId, isTextSuccessful);
            });
        }
        static void Main(string[] args)
        {
            var messages = new TextMessages();
            var repo     = new TextRepository();
            var stats    = new TextStatsReport();

            Console.WriteLine("Listening for TextScoreTask event, press Ctrl+C to stop...");
            messages.ConsumeMessagesInLoop(TextMessages.QueueTextStatistics, TextMessages.ExchangeTextRankCalculated, (model, json) => {
                TextRankCalculatedMessage message = TextRankCalculatedMessage.FromJson(json);
                stats.AddRankResult(message.Score);
                repo.SetStatsReport(stats.ToJson());
            });
        }