public static EventChannel AddChannel(IEventChannelService channelService, int timeout = 30) { EventChannel channel; //Act var executionGetResult = channelService.GetChannelAsync(x => x.Name == "TestChannel").Result; executionGetResult.Should().NotBeNull(); executionGetResult.IsSuccessful.Should().BeTrue(); if (executionGetResult.Result == null) { var executionResult = channelService.RegisterChannelAsync(new EventChannel { IsFifo = true, Key = Guid.NewGuid().ToString(), Name = "TestChannel", MaxLifeTimeMessage = timeout, MaxLifeTimeSubscriber = timeout }).Result; executionResult.Should().NotBeNull(); executionResult.IsSuccessful.Should().BeTrue(); channel = executionResult.Result; } else { channel = executionGetResult.Result; } channel.Should().NotBeNull(); return(channel); }
public EventLiveStreamerService(IEventChannelRepository eventChannelRepository, IEventSubscriptionRepository eventSubscriptionRepository, IEventRepository eventMessageRepository, ILoggerFactory loggerFactory, DiagnosticSource diagnosticSource) { _diagnosticSource = diagnosticSource; _eventChannelRepository = new EventChannelService(eventChannelRepository); _eventSubscriptionService = new EventSubscriptionService(eventSubscriptionRepository); _eventMessageService = new EventMessageService(eventMessageRepository); _logger = loggerFactory.CreateLogger <EventLiveStreamerService>(); }