如何在ASP.NET Core Akka中正确配置调度程序



我正在向我的akka.net配置添加固定的调度员

 using (_actorSystem = ActorSystem.Create("SchedulerAutoAction"))
            {
                var props = Props.Create<TaskSchedulerAktor>().WithDispatcher("pinned-dispatcher"); // handle the mailbox timely
                _actorRef = _actorSystem.ActorOf(props, "TaskSchedulerAutoActionActor");
            }

我想根据固定调度员运行此操作,但目前我在终端中遇到了此错误

Unhandled Exception: Akka.Configuration.ConfigurationException: Dispatcher [pinned-dispatcher] not configured for path akka://SchedulerAutoAction/user/TaskSchedulerAutoActionActor
   at Akka.Actor.LocalActorRefProvider.ActorOf(ActorSystemImpl system, Props props, IInternalActorRef supervisor, ActorPath path, Boolean systemService, Deploy deploy, Boolean lookupDeploy, Boolean async)

有人使用调度程序并正确配置吗?您能建议对我的代码有任何改进吗?请让我知道

您作为调度程序标识符传递的字符串参数实际上是您的演员系统配置中的Hocon路径:对于PinnedDisPatcher,该路径可以是Akkka.io.pinned-dispatcher。

ps:请记住,您可以创建自己的固定设置 - 详细信息在我上面链接的文档中。

最新更新