Пример #1
0
 public GameDataService(
     IMapper mapper,
     IUnitOfWork unitOfWork,
     ICurrentUserProvider currentUserProvider,
     ISignalRNotificationService notificationService
     )
     : base(mapper, unitOfWork)
 {
     _notificationService = notificationService;
     _currentUserProvider = currentUserProvider;
 }
Пример #2
0
 public UserService(
     IMapper mapper,
     IUnitOfWork uow,
     ICurrentUserProvider currentUserProvider,
     ISignalRNotificationService notificationService,
     ISearchService searchService
     ) : base(mapper, uow)
 {
     _currentUserProvider = currentUserProvider;
     _notificationService = notificationService;
     _searchService       = searchService;
 }
Пример #3
0
        public ActorViewerActor(ISignalRNotificationService signalRNotificationService)
        {
            ActorDebugUpdateMessages   = new List <ActorDebugUpdateMessage>();
            SignalRNotificationService = signalRNotificationService;
            Receive <ActorDebugUpdateMessage>(message =>
            {
                ActorDebugUpdateMessages.Add(message);
                UniqueMessages[message.SourceActor]      = message;
                UniqueMessages[message.DestinationActor] = message;
            });
            Receive <UpdateClients>(_ =>
            {
                var last = ActorDebugUpdateMessages.Count - 1;
                if (last < 0)
                {
                    return;
                }

                var lattestUpdate = ActorDebugUpdateMessages[last];
                SignalRNotificationService.SendLastUpdate(lattestUpdate);
                Console.WriteLine(ActorDebugUpdateMessages.Count + " Messages so far - " + lattestUpdate?.ToString());
            });
            Receive <QueryDebugUpdatesMessage>(message =>
            {
                var resultSet =
                    // ActorDebugUpdateMessages/*.Where(x => x.ReceivedOn >= message.From && x.ReceivedOn <= message.To)*/
                    UniqueMessages.Select(x => x.Value)
                    .Skip(message.Skip)
                    .Take(message.Take)
                    .ToList();
                Sender.Tell(new QueryDebugUpdatesCompletedMessage(resultSet));
                SignalRNotificationService.SendDebugUpdates(new QueryDebugUpdatesCompletedMessage(resultSet));
            });
            ReceiveAny(Console.WriteLine);
            Context.System.Scheduler.ScheduleTellRepeatedly(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(3), Self, new UpdateClients(), Self);
        }
Пример #4
0
 public WebNotificationManager(ISignalRNotificationService notificationHub)
 {
     _notificationHub = notificationHub;
 }