A lightweight, typed Actor library for Scala and Scala.js to build concurrent data pipelines and state machines.
Castor is a lightweight, typed Actor library for Scala and Scala.js that allows developers to build concurrent data pipelines and state machines. It solves the problem of managing asynchronous, non-blocking message processing within a single process, providing a simpler alternative to heavier frameworks like Akka.
Scala developers building concurrent applications, such as web servers (e.g., Cask framework), file synchronizers, or any system requiring asynchronous data processing without the overhead of distributed actor systems.
Developers choose Castor for its minimal footprint, type safety, and ease of testing—actors are garbage collectible and can be run deterministically in single-threaded environments, making it ideal for both JVM and Scala.js projects.
Castor is a lightweight, typed Actor library for Scala and Scala.js
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Castor has minimal overhead with compile-time type safety for message passing, as shown in the typed Actor[T] trait, reducing runtime errors compared to untyped alternatives.
Actors are automatically managed without manual lifecycle termination, simplifying resource management—this is explicitly highlighted in the README as a key advantage over frameworks needing explicit shutdown.
Provides Context.Test with waitForInactivity() to run actors single-threaded, enabling reliable tests without timing-based assertions, as demonstrated in the debugging section.
Runs on both JVM multithreaded environments and Scala.js single-threaded environments like browsers, making it versatile for full-stack Scala applications.
Castor explicitly does not support clustering or distributed actors, limiting it to single-process applications and making it unsuitable for scalable, fault-tolerant systems.
Compared to established frameworks like Akka, Castor has a smaller community, fewer integrations, and is less battle-tested in production at scale, which might increase development risk.
Developers must ensure proper encapsulation of mutable state in actors, and errors in batching logic (e.g., in BatchActor) can lead to nondeterministic behavior, as warned in the README.
castor is an open-source alternative to the following products: