Ejemplo n.º 1
0
        public RepeatActionManager(ILogger <RepeatActionManager> logger,
                                   IOptions <RepeatActionManagerConfig> config, AllTypeInstances <IRepeatAction> repeatActions)
        {
            logger.LogDebug($"In ctor()");

            var children = new List <IActorRef>();
            int idx      = 0;

            foreach (var instance in repeatActions.Instances)
            {
                foreach (var action in instance.RepeatingActions)
                {
                    var workerActor = Context.ActorOf(Context.DI().Props <RepeatActionWorker>(),
                                                      $"{nameof(RepeatActionWorker)}-{action.ActionName}{idx++}");
                    Context.System.Scheduler.ScheduleTellOnce(
                        TimeSpan.FromSeconds(config.Value.StartupDelayInSeconds),
                        workerActor, new RepeatMessage(action), Self);
                    children.Add(workerActor);
                }
            }
        }
Ejemplo n.º 2
0
 public MyTestInterfaceACollection(AllTypeInstances <testInterfaceA> typeInstances)
 {
     Types     = typeInstances.Types;
     Instances = typeInstances.Instances;
 }