Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bastion Documentation and New project logos #84

Merged
merged 1 commit into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bastion/examples/getting_started.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn main() {
let answer: Answer = child
.ask("A message containing data.")
.expect("Couldn't send the message.");
async {
let _ = async {
// ...until the child eventually answers back...
let _answer: Result<Msg, ()> = answer.await;
};
Expand Down
3 changes: 3 additions & 0 deletions bastion/src/children.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//!
//! Children are a group of child supervised under a supervisor
//! Allows users to communicate with children through the mailboxes.
use crate::broadcast::{Broadcast, Parent, Sender};
use crate::context::{BastionContext, BastionId, ContextState};
use crate::message::{Answer, BastionMessage, Message};
Expand Down
25 changes: 25 additions & 0 deletions bastion/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@ pub(crate) const NIL_ID: BastionId = BastionId(Uuid::nil());
#[derive(Hash, Eq, PartialEq, Debug, Clone)]
pub(crate) struct BastionId(Uuid);

///
/// Context for the inter children communication.
///
/// # Example
///
/// ```rust
/// # use bastion::prelude::*;
/// #
/// # fn main() {
/// # Bastion::init();
/// #
/// Bastion::children(|children| {
/// children.with_exec(|ctx: BastionContext| {
/// async move {
/// format!("{:#?}", ctx.current());
/// Ok(())
/// }
/// })
/// }).expect("Couldn't create the children group.");
/// #
/// # Bastion::start();
/// # Bastion::stop();
/// # Bastion::block_until_stopped();
/// # }
/// ```
#[derive(Debug)]
pub struct BastionContext {
id: BastionId,
Expand Down
29 changes: 19 additions & 10 deletions bastion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@
//! called [lightproc] and utilize all the system resources
//! efficiently with at-most-once message delivery guarantee.
//!
//! ## Why Bastion?
//! If one of the questions below answered with yes, then Bastion is just for you:
//! * Do I need fault-tolerance 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 need an executor which is using system resources efficiently?
//! * Do I have some trust issues against orchestration systems? Because I want to implement my own application lifecycle.
//! To have a quick start please head to: [Bastion System Documentation](struct.Bastion.html).
//!
//! ## Features
//! * Message-based communication makes this project a lean mesh of actor system.
Expand All @@ -31,10 +24,24 @@
//! ## Guarantees
//! * At most once delivery for all the messages.
//! * Completely asynchronous system design.
//! * Asynchronous program boundaries
//! *
//! * Asynchronous program boundaries with [fort].
//! * Dynamic supervision of supervisors (adding a subtree later during the execution)
//! * Lifecycle management both at `futures` and `lightproc` layers.
//! * Faster middleware development.
//! * Above all "fault-tolerance".
//!
//! ## Why Bastion?
//! If one of the questions below answered with yes, then Bastion is just for you:
//! * Do I need fault-tolerance in my project?
//! * Do I need to write resilient middleware/s?
//! * I shouldn't need a webserver to run an actor system, right?
//! * Do I want to make my existing code unbreakable?
//! * Do I need an executor which is using system resources efficiently?
//! * Do I have some trust issues against orchestration systems? Because I want to implement my own application lifecycle.
//!
//!
//! [lightproc]: https://docs.rs/lightproc/
//! [fort]: https://docs.rs/fort/
//!

#![doc(
Expand All @@ -55,6 +62,8 @@ pub mod children;
pub mod message;
pub mod supervisor;

///
/// Prelude of Bastion
pub mod prelude {
pub use crate::bastion::Bastion;
pub use crate::children::{ChildRef, Children, ChildrenRef};
Expand Down
8 changes: 8 additions & 0 deletions bastion/src/message.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
//!
//! Dynamic dispatch oriented messaging system
//!
//! This system allows:
//! * Generic communication between mailboxes.
//! * All message communication relies on at-most-once delivery guarantee.
//! * Messages are not guaranteed to be ordered, all message's order is causal.
//!
use crate::children::Children;
use crate::context::BastionId;
use crate::supervisor::{SupervisionStrategy, Supervisor};
Expand Down
3 changes: 3 additions & 0 deletions bastion/src/supervisor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//!
//! Supervisors enable users to supervise a subtree of children
//! or other supervisor trees under themselves.
use crate::broadcast::{Broadcast, Parent, Sender};
use crate::children::{Children, ChildrenRef};
use crate::context::BastionId;
Expand Down
Binary file modified img/bastion-logo.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bastion-transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/bastion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.