コード例 #1
0
        private async Task VotingReviewConsumerReceivedAsync(object sender, RabbitQueueConsumerData e)
        {
            var method = "votingReview";
            var json   = JsonSerializer.Deserialize <VotingReviewModel>(e.Data, jsonSerializerOptions);

            await hubContext.Clients.All.SendAsync(method, json);

            e.Channel.BasicAck(e.DeliveryTag, false);
        }
コード例 #2
0
        public async Task SystemTimeConsumerReceivedAsync(object sender, RabbitQueueConsumerData e)
        {
            var method = "systemTime";
            var json   = JsonSerializer.Deserialize <SystemTimeModel>(e.Data, jsonSerializerOptions);

            await hubContext.Clients.All.SendAsync(method, json);

            e.Channel.BasicAck(e.DeliveryTag, false);
        }
コード例 #3
0
        public async Task PresentMembersConsumerReceivedAsync(object sender, RabbitQueueConsumerData e)
        {
            var method = "presentMembers";
            var json   = JsonSerializer.Deserialize <PresentMembersModel>(e.Data, jsonSerializerOptions);

            SaveDataToCache(method, json);

            await hubContext.Clients.All.SendAsync(method, json);

            e.Channel.BasicAck(e.DeliveryTag, false);
        }
コード例 #4
0
        public async Task VotingEndConsumerReceivedAsync(object sender, RabbitQueueConsumerData e)
        {
            var method = "votingEnd";
            var json   = JsonSerializer.Deserialize <VotingEndModel>(e.Data, jsonSerializerOptions);

            var result = PrepareVotingEndData(json);

            await hubContext.Clients.All.SendAsync(method, result);

            e.Channel.BasicAck(e.DeliveryTag, false);
        }