示例#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;
 }
        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;
 }