Beispiel #1
0
        public static async Task <IEventPublisher> Create(string applicationName, string connectionString)
        {
            var queueDbAccessManager = new QueueDbAccessManager(applicationName, connectionString);
            await queueDbAccessManager.CreateQueueDbIfNeeded();

            return(new EventPublisher(queueDbAccessManager));
        }
Beispiel #2
0
 internal QueueConfig(string applicationName, string connectionString, TimeSpan delay, TimeSpan interval, bool listen)
 {
     ConnectionString     = connectionString;
     Delay                = delay;
     Interval             = interval;
     Listen               = listen;
     QueueDbAccessManager = new QueueDbAccessManager(applicationName, connectionString);
 }
Beispiel #3
0
        public EventHandlerActor(Dictionary <string, Tuple <Type, List <Type> > > eventHandlerDictionary, QueueDbAccessManager queueDbAccessManager, IServiceScopeFactory serviceScopeFactory)
        {
            _eventHandlerDictionary = eventHandlerDictionary;
            _queueDbAccessManager   = queueDbAccessManager;
            _serviceScopeFactory    = serviceScopeFactory;

            ReceiveAsync <Event>(Handle);
        }
Beispiel #4
0
        public EventListenerActor(IActorRef eventHandlerActor, TimeSpan interval, QueueDbAccessManager queueDbAccessManager)
        {
            _eventHandlerActor    = eventHandlerActor;
            _interval             = interval;
            _queueDbAccessManager = queueDbAccessManager;

            ReceiveAsync <string>(s => s == ListenCommand, s => Listen().PipeTo(Self));
            Receive <string>(msg => msg == ScheduleNextListenCommand, msg => ScheduleNextListen());
        }
Beispiel #5
0
 internal EventPublisher(QueueDbAccessManager queueDbAccessManager)
 {
     _queueDbAccessManager = queueDbAccessManager ?? throw new ArgumentNullException(nameof(queueDbAccessManager));
 }