[−][src]Crate bastion
Bastion: Fault-tolerant Runtime for Rust applications
Bastion is a fault-tolerant runtime which is designed for recovering from faults based on the supervision strategies that you've passed. It is designed to provide persistent runtime for applications which need to be highly-available.
Why Bastion?
If one of the questions below answered with yes, then Bastion is just for you:
- Do I need fault-tolerancy in my project?
- Do I hate to implement weird Actor traits?
- I shouldn't need a webserver to run an actor system, right?
- Do I want to make my existing code unbreakable?
- Do I have some trust issues against orchestration systems? Because I want to implement my own application lifecycle.
Features
- Message-based communication makes this project a lean mesh of actor system.
- without web servers, weird shenanigans, forced trait implementations, and static dispatch.
- Runtime fault-tolerance makes it a good candidate for small scale distributed system code.
- If you want to smell of Erlang and it's powerful aspects in Rust. That's it!
- Supervision makes it easy to manage lifecycles.
- Kill your application in certain condition or restart you subprocesses whenever a certain condition met. All up to you. And it should be up to you.
Modules
bastion | Main module for the runtime. |
child | Child management, message generics and communication reside in this module. |
config | Platform configuration for Bastion runtime |
context | Context is generic structure to share resource between supervisor, children and the system. |
macros | Macros to use in processes and defining the architecture of runtime. |
messages | Generic message types for management of runtime, processes and layers. |
prelude | Prelude for bare minimum runtime dependencies |
receive | Implementations for message gating, receiving and destination definitions. |
supervisor | Supervisor related code. Including their management, creation, and destruction. |
Macros
receive | Matches incoming messages to the process.
Always have a |