Uses:
- .NET 8
- Akka.NET (Core, Hosting, DI, Remote, Cluster, Persistence)
- LanguageExt (Functional C# Utilities)
- ASP.NET
Running via the supplied docker-compose
is the easiest and most straightforward way to run the entire project. It will
automatically:
- Start Postgres
- Apply EF migrations from
Anet.Migrations
- Start the
primary
Anet Actor System - Start the peer Anet Actor Systems to form a cluster
Note, if you're running on OSX, you may need to prepend DOCKER_DEFAULT_PLATFORM=linux/arm64
docker-compose up
API available at http://localhost:8000
You can run a single instance of Anet via the dotnet
CLI (via dotnet run
), however you must have Postgres running with the appropriate schema so Akka Persistence may still work. You can do this by simply upping Postgres and the EF migrations from the docker-compose by running docker-compose up pg migrations
.
- /Anet.API: The ASP.NET API Server
- /Anet.Core: Akka Implementation Details (Actors, Utilites, etc)
- /Anet.Db: The Entity Framework schema/model definitions
- /Anet.Migrations: The Entity Framework Postgres migrations
A bruno
collection (located at .bruno
) is included in the project that enumerates the various API endpoints, which interact with the various Actors implemented in the project.
There are the following actors in the project for reference. They iteratively build on each other to demonstrate the different facets of the Akka ecosystem.
A set of simple actors to model ping/ponging messages back to a user.
Demonstrating Akka Actor internal timers and managing internal state via FSM (Finite State Machine).
Demonstrating Akka Actor persistence via Postgres.
Demonstrating Akka Actor Cluster Sharding across a 3 node cluster.