Highly-available Distributed Fault-tolerant Runtime
Changes:
Getting Started | Examples | API documentation
This release is coming with exciting features:
scaling
feature enabled, you can create actor groups in Bastion that will adapt to incoming workload according to given resizer parameters. children
.with_redundancy(3) // Start with 3 actors
.with_heartbeat_tick(Duration::from_secs(5)) // Do heartbeat each 5 seconds
.with_resizer(
OptimalSizeExploringResizer::default()
.with_lower_bound(1) // A minimal acceptable size of group
.with_upper_bound(UpperBound::Limit(10)) // Max 10 actors in runtime
.with_upscale_strategy(UpscaleStrategy::MailboxSizeThreshold(3)) // Scale up when a half of actors have more than 3 messages
.with_upscale_rate(0.1) // Increase the size of group on 10%, if necessary to scale up
.with_downscale_rate(0.2), // Decrease the size of group on 20%, if there are too many idle actors
)
children
.with_heartbeat_tick(Duration::from_secs(5)) // Do heartbeat each 5 seconds
// At the beginning we're creating a new instance of RestartStrategy
// we then provide a policy and a back-off strategy.
let restart_strategy = RestartStrategy::default()
// Set the limits for supervisor, so that it could stop
// after 3 attempts. If the actor can't be started, the supervisor
// will remove the failed actor from tracking.
.with_restart_policy(RestartPolicy::Tries(3))
// Set the desired restart strategy. By default supervisor will
// try to restore the failed actor as soon as possible. However,
// in our case we want to restart with a small delay between the
// tries. Let's say that we want a regular time interval between the
// attempts which is equal to 1 second.
.with_actor_restart_strategy(ActorRestartStrategy::LinearBackOff {
timeout: Duration::from_secs(1),
});
Getting Started | Examples | API documentation
Bastion 0.3.0
is here, and it is a huge milestone for the project.
Features were added, the API was upgraded, the code was cleaned up, bugs were smashed but most importantly, Bastion is more powerful than it has ever been.
getting_started.rs
std::future::Future
.
std::future::Future
with Result<(), ()>
as an output to
indicate whether they stopped or faulted.msg!
and answer!
).Bastion
, SupervisorRef
and ChildrenRef
).Bastion
, SupervisorRef
, ChildrenRef
and ChildRef
).SupervisorRef
).SupervisorRef
).before_start
, before_restart
, after_restart
and
after_stop
)..current()
, .parent()
or .supervisor()
).bastion-executor
) and processes abstraction
(lightproc
).unstable
feature.