コード例 #1
0
 public SignalRSubscriber(IUiEventBus dispatcher, IClientSession session, ILogger logger)
 {
     this._dispatcher  = dispatcher;
     this._session     = session;
     this._logger      = logger;
     _subscribedEvents = new HashSet <Type>();
 }
コード例 #2
0
            public async Task Configure(bool fromBeginning, HubConnection connection, IUiEventBus uiEventBus, ILogger logger, string projectionType)
            {
                _uiEventBus = uiEventBus;
                _logger     = logger;
                var eventName = $"{projectionType}.{typeof(TEvent).Name}";

                connection.On(eventName, new Action <EventMetadata, TEvent>(OnReadEvent));
                // Should we wait for the subscription? - or should we re-subscribe
            }
コード例 #3
0
            public async Task Configure(bool isPersistent, HubConnection connection, IUiEventBus uiEventBus, ILogger logger)
            {
                _uiEventBus = uiEventBus;
                _logger     = logger;
                var eventName = typeof(TEvent).FullName.Replace(".", "-");

                connection.On(eventName, new Action <EventMetadata, TEvent>(OnReadEvent));
                // Should we wait for the subscription? - or should we re-subscribe
                logger.Information("Subscribing to {eventName} with method {methodName}", typeof(TEvent).Name, eventName);
                await connection.InvokeAsync("SubscribeToEvent", isPersistent, typeof(TEvent).AssemblyQualifiedName);

                logger.Information("Subscribed to {eventName}.", typeof(TEvent).Name);
            }
コード例 #4
0
 protected AppProcess()
 {
     _eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>();
     _bus             = ServiceLocator.Current.GetInstance <IUiEventBus>();
     WireEvents();
 }