Exemple #1
0
        public DbEventReceiver(
            PostgresEventReceiverOptions eventReceiverOptions,
            MonitoredDatabase monitoredDatabase,
            ILogger <DbEventReceiver> logger)
        {
            _eventReceiverOptions = eventReceiverOptions ?? throw new ArgumentNullException(nameof(eventReceiverOptions));
            eventReceiverOptions.AssertValid();
            _dbOptions = monitoredDatabase ?? throw new ArgumentNullException(nameof(monitoredDatabase));
            _logger    = logger ?? throw new ArgumentNullException(nameof(logger));

            _eventsToSubscribe = new HashSet <string>(eventReceiverOptions.EventNames);
        }
Exemple #2
0
        public DbEvent(
            MonitoredDatabase databaseInfo,
            string eventName,
            string?payload)
        {
            DatabaseInfo = databaseInfo ?? throw new ArgumentNullException(nameof(databaseInfo));
            if (String.IsNullOrWhiteSpace(eventName))
            {
                throw new ArgumentNullException(nameof(eventName));
            }

            EventName = eventName;
            Payload   = payload;
        }