Пример #1
0
        public RedisNotificationsService(INotificationsServerSentEventsService notificationsServerSentEventsService, IConfiguration configuration)
            : base(notificationsServerSentEventsService)
        {
            _redis = ConnectionMultiplexer.Connect(configuration.GetValue <String>(CONNECTION_MULTIPLEXER_CONFIGURATION_KEY));

            ISubscriber subscriber = _redis.GetSubscriber();

            subscriber.Subscribe(NOTIFICATIONS_CHANNEL, async(channel, message) => { await SendSseEventAsync(message, false); });
            subscriber.Subscribe(ALERTS_CHANNEL, async(channel, message) => { await SendSseEventAsync(message, true); });
        }
Пример #2
0
        public RedisNotificationsService(INotificationsServerSentEventsService notificationsServerSentEventsService, IConfiguration configuration)
        // : base(notificationsServerSentEventsService)
        {
            _notificationsServerSentEventsService = notificationsServerSentEventsService;
            _redis = ConnectionMultiplexer.Connect("localhost");

            ISubscriber subscriber = _redis.GetSubscriber();

            subscriber.Subscribe(NOTIFICATIONS_CHANNEL, async(channel, message) => { await SendSseEventAsync(message); });
        }
 public LocalNotificationsService(INotificationsServerSentEventsService notificationsServerSentEventsService)
     : base(notificationsServerSentEventsService)
 {
 }
Пример #4
0
 public HomeController(IHostingEnvironment env, IHttpContextAccessor httpContextAccessor, INotificationsServerSentEventsService serverSentEventsService)
 {
     this._env = env;
     this._httpContextAccessor     = httpContextAccessor;
     this._serverSentEventsService = serverSentEventsService;
 }
 public NotificationsController(INotificationsServerSentEventsService serverSentEventsService)
 {
     _serverSentEventsService = serverSentEventsService;
 }
 protected NotificationsServiceBase(INotificationsServerSentEventsService notificationsServerSentEventsService)
 {
     _notificationsServerSentEventsService = notificationsServerSentEventsService;
 }