Пример #1
0
        public virtual Task Schedule(DeferMessage deferMessage)
        {
            if (_actorScheduler == null)
            {
                _actorScheduler = Actor.Spawn(Actor.FromProducer(() => this));
            }

            _actorScheduler.Tell(deferMessage);
            return(Task.CompletedTask);
        }
Пример #2
0
        public override async Task Schedule(DeferMessage deferMessage)
        {
            if (_distributedClusterActor == null)
            {
                (PID, ResponseStatusCode)distributedClusterActor = await Cluster
                                                                   .GetAsync(nameof(ClusterDistributedTimer), "DistributedTimer")
                                                                   .ConfigureAwait(false);

                _distributedClusterActor = distributedClusterActor.Item1;
            }

            _distributedClusterActor.Tell(deferMessage);
        }