Akka.Hosting.Maui
1.5.8
Prefix Reserved
dotnet add package Akka.Hosting.Maui --version 1.5.8
NuGet\Install-Package Akka.Hosting.Maui -Version 1.5.8
<PackageReference Include="Akka.Hosting.Maui" Version="1.5.8" />
paket add Akka.Hosting.Maui --version 1.5.8
#r "nuget: Akka.Hosting.Maui, 1.5.8"
// Install Akka.Hosting.Maui as a Cake Addin #addin nuget:?package=Akka.Hosting.Maui&version=1.5.8 // Install Akka.Hosting.Maui as a Cake Tool #tool nuget:?package=Akka.Hosting.Maui&version=1.5.8
Akka.Hosting.Maui
HOCON-less configuration, application lifecycle management, ActorSystem
startup, and actor instantiation for Akka.NET. This is an Akka.Hosting adapter for .NET Maui applications.
The reason this exists in the first place is because Microsoft.Extensions.Hosting aren't supported on .NET Maui and there are no plans to support it. We've adapted Akka.Hosting to run using a Maui IMauiInitializeService
instead an IHostedService
behind the scenes - and this should make it trivially easy to use Akka.Hosting's 'ActorRegistry' to inject actors into your UI elements and background services.
Installation
First, you need to install the Akka.Hosting.Maui package into your Maui application:
dotnet add package Akka.Hosting.Maui
Next, inside your MauiProgram.cs
(or equivalent) call the AddAkkaMaui
method:
using Akka.Hosting.Maui;
using Akka.Hosting.MauiSample;
using Microsoft.Extensions.Logging;
namespace Akka.Hosting.MauiDemo;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
#if DEBUG
builder.Logging.AddDebug();
#endif
builder.Services
.AddAkkaMaui("TestSys", config =>
{
config.WithActors((system, registry) =>
{
var echo = system.ActorOf(ClickActor.Props);
registry.Register<ClickActor>(echo);
});
})
.AddTransient<MainPage>();
return builder.Build();
}
}
And from there, you should be able to use any of the other Akka.Hosting methods to configure your ActorSystem
and your actors!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-android31.0 is compatible. net6.0-ios was computed. net6.0-ios16.1 is compatible. net6.0-maccatalyst was computed. net6.0-maccatalyst16.1 is compatible. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net6.0-windows10.0.19041 is compatible. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Akka.Hosting (>= 1.5.8)
-
net6.0-android31.0
- Akka.Hosting (>= 1.5.8)
-
net6.0-ios16.1
- Akka.Hosting (>= 1.5.8)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
-
net6.0-maccatalyst16.1
- Akka.Hosting (>= 1.5.8)
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
-
net6.0-windows10.0.19041
- Akka.Hosting (>= 1.5.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
• Fixed bugs