private DemoActor CreateTestDemoActor(IRemindableWrapper remindableWrapper, IActorStateManager actorStateManager, IHelloDaprWorld daprWorld = null) { var actorTypeInformation = ActorTypeInformation.Get(typeof(DemoActor)); Func <ActorService, ActorId, DemoActor> actorFactory = (service, id) => new DemoActor(service, id, daprWorld, remindableWrapper, actorStateManager); var actorService = new ActorService(actorTypeInformation, actorFactory); var demoActor = actorFactory.Invoke(actorService, ActorId.CreateRandom()); return(demoActor); }
/// <summary> /// Initializes a new instance of the <see cref="DemoActor"/> class. /// </summary> /// <param name="service">Actor Service hosting the actor.</param> /// <param name="actorId">Actor Id.</param> public DemoActor(ActorService service , ActorId actorId , IHelloDaprWorld daprWorldService , IRemindableWrapper remindableWrapper = null , IActorStateManager actorStateManager = null ) : base(service, actorId) { this.daprWorldService = daprWorldService ?? throw new ArgumentNullException(nameof(daprWorldService)); this.remindableWrapper = remindableWrapper ?? new RemindableWrapper(RegisterReminderAsync); this.actorStateManager = actorStateManager ?? this.StateManager;; }
public SampleActor(ActorService service, ActorId actorId, string configSetting1, string configSetting2 , IRemindableWrapper remindableWrapper = null , IActorStateManager actorStateManager = null ) : base(service, actorId) { this.configSetting1 = configSetting1; this.configSetting2 = configSetting2; this.remindableWrapper = remindableWrapper ?? new RemindableWrapper(RegisterReminderAsync); this.actorStateManager = actorStateManager ?? this.StateManager; }
public SampleActor(ActorHost host , IRemindableWrapper remindableWrapper = null , IActorStateManager actorStateManager = null ) : base(host) { this.configSetting1 = "configSetting1"; this.configSetting2 = "configSetting2"; this.remindableWrapper = remindableWrapper ?? new RemindableWrapper(RegisterReminderAsync); this.actorStateManager = actorStateManager ?? this.StateManager; }