Пример #1
0
 public CreatePrivilegeActor(IFileProcessorRepository fileProcessorRepository)
 {
     _fileProcessorRepository = fileProcessorRepository ?? throw new ArgumentNullException(nameof(fileProcessorRepository));
     _logger         = Context.GetLogger();
     _parentActorRef = Context.Parent;
     _currentRecord  = String.Empty;
     Become(WaitingToWork);
     _cancelToken = new CancellationTokenSource();
 }
        public DatabaseWatcherActor(IFileProcessorRepository fileProcessorRepository, DistributedPubSub distributedPubSub)
        {
            _fileProcessorRepository = fileProcessorRepository ?? throw new ArgumentNullException(nameof(fileProcessorRepository));
            _logger    = Context.GetLogger();
            _locations = new Dictionary <string, LocationModel>();
            _subscriptionsToObjects = new Dictionary <IActorRef, ObjectSubscription>();
            _cancelToken            = new CancellationTokenSource();

            _mediator = distributedPubSub?.Mediator ?? ActorRefs.Nobody;

            BecomeGettingLocations();
        }
Пример #3
0
        public DatabaseWatcherActor(IFileProcessorRepository fileProcessorRepository)
        {
            _fileProcessorRepository = fileProcessorRepository ?? throw new ArgumentNullException(nameof(fileProcessorRepository));
            _logger    = Context.GetLogger();
            _locations = new Dictionary <string, LocationModel>();
            _subscriptionsToObjects = new Dictionary <IActorRef, ObjectSubscription>();
            _cancelToken            = new CancellationTokenSource();

            // TODO: This needs to be fixed... How do I create the mediator in my Tests or do I need to inject?
            //_mediator = DistributedPubSub.Get(Context.System).Mediator ?? ActorRefs.Nobody;

            BecomeGettingLocations();
        }