akka-net-best-practices

Guide Akka.NET actor system design with communication and supervision best practices.

Updated Dec 4, 2022
One-click install
npx skills add https://github.com/devingoble/CloudOStat --skill akka-net-best-practices-devingoble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: akka-net-best-practices
Source: https://github.com/devingoble/CloudOStat/tree/main/.github/skills/akka-best-practices
Command: npx skills add https://github.com/devingoble/CloudOStat --skill akka-net-best-practices-devingoble

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides critical best practices for building robust, scalable, and maintainable Akka.NET actor systems, addressing common pitfalls in communication, error handling, and design.

Core Features & Use Cases

  • Communication Patterns: Differentiates between local EventStream and distributed DistributedPubSub.
  • Supervision Strategies: Explains when and how to implement effective supervision.
  • Error Handling: Guides on using Try-Catch vs. supervision for different failure scenarios.
  • Dependency Management: Compares Props.Create with DependencyResolver for actor instantiation.
  • Work Distribution: Outlines patterns like database queues and Akka.Streams throttling.
  • Cluster/Local Abstraction: Provides patterns for testable actor systems in both local and clustered modes.
  • Use Case: You are designing a new microservice using Akka.NET and need to ensure your actor communication is efficient, your error handling is robust, and your system is testable. This Skill will guide you through the critical design decisions.

Quick Start

Use the akka-net-best-practices skill to understand when to use EventStream versus DistributedPubSub for actor communication.

Frequently Asked Questions about akka-net-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in Akka.NET using supervision strategies?

Use supervision strategies for actor failures to let the parent decide whether to resume, restart, or stop the child actor, reserving try-catch blocks for expected edge cases where standard supervision does not apply.

What is the best way to distribute work across an Akka.NET cluster?

Distribute work across an Akka.NET cluster using database queues or Akka.Streams throttling patterns, which provide reliable backpressure and load balancing for scalable distributed systems.

When should I use EventStream versus DistributedPubSub in Akka.NET?

Use local EventStream for in-process actor messaging within a single actor system, and switch to DistributedPubSub when broadcasting messages across nodes in an Akka.NET cluster.

Should I use Props.Create or DependencyResolver for instantiating Akka.NET actors?

Use Props.Create for explicit actor instantiation and testability, while DependencyResolver integration suits complex dependency injection scenarios requiring external container management.

How do I abstract local and cluster modes for testable Akka.NET actor systems?

Abstract local and cluster modes by designing actor systems with location-transparent routing, ensuring seamless transitions between local execution and distributed cluster deployments for robust testing.