Super lightweight implementation of the Actor Model in Go, inspired by frameworks like Akka in Scala. This library provides a simple and efficient way to build concurrent and distributed systems using the actor paradigm.
-
Actor Model Basics:
- Actors as independent units of computation.
- Message-passing between actors for communication.
- Asynchronous and non-blocking message processing.
-
Concurrency:
- Each actor runs in its own goroutine, enabling high concurrency.
- Actors process messages sequentially, ensuring thread-safe state management.
-
Supervision:
- Parent actors can supervise child actors.
- If a child actor panics, the parent actor is notified and can take appropriate action.
-
Lifecycle Hooks:
preStart
andpostStop
hooks for custom initialization and cleanup logic.
-
Child Actor Management:
- Actors can spawn child actors dynamically.
- Parent actors manage the lifecycle of their children.
-
Simple API:
- Easy-to-use API for creating actors, sending messages, and managing their lifecycle.
-
Distributed Actors:
- This library does not support distributed actors (actors running on different machines). Akka provides built-in support for clustering and remote actors.
-
Persistence:
- There is no built-in support for actor state persistence. Akka provides Akka Persistence for saving and recovering actor state.
-
Advanced Routing:
- This library does not include advanced message routing strategies (e.g., round-robin, consistent hashing) like Akka's Router feature.
-
Event Sourcing:
- No support for event sourcing, which is a key feature of Akka Persistence.
-
Streams:
- Akka Streams provide a powerful API for stream processing. This library does not include any streaming capabilities.
-
Advanced Supervision Strategies:
- Akka allows defining custom supervision strategies (e.g., OneForOneStrategy, AllForOneStrategy). This library provides basic supervision but lacks advanced strategies.
-
Type Safety:
- Akka leverages Scala's type system for type-safe messaging. This library uses
interface{}
for messages, which lacks type safety.
- Akka leverages Scala's type system for type-safe messaging. This library uses
-
Backpressure Handling:
- Akka Streams and Actors provide backpressure handling. This library does not handle backpressure explicitly.
TBD
go get github.com/solodynamo/go-actors