Trying to register an Actor System using AKKA.net in the latest WiseJ -cant figure out how to get access to it later in the code. I have been able to use a static class in older version of WiseJ -non Net Core. But reading online this may not work well anymore)
in startup.cs I have:
builder.Services.AddAkka(“SystemControlPoints”, (builder, provider) =>
{
builder
// Instantiate actors
.WithActors((system, registry) =>
{
// Props == formula for creating an actor
Props myProps = Props.Create<HelloActor>();
IActorRef myActor = system.ActorOf(myProps, “MyActor”);
registry.Register<HelloActor>(myActor);
// tell my actor to display a message via Fire-and-Forget messaging
myActor.Tell(“Hello, World!”);
});
});
Hello Edmond,
To use the Microsoft Service container, you’ll have to register it like the following example:
// Register Microsoft's IServiceProvider with Wisej.NET.
Application.Services.AddService<IServiceProvider>(app.Services);
For the complete sample, please refer to our documentation covering Dependency Injection.
Let me know in case you need additional help!
Best Regards,
Alaa
Please login first to submit.