Skip to content

Commit

Permalink
Added documentation about what the "system supervisor" is.
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v2d0g committed Nov 11, 2019
1 parent 4c4d127 commit 134b430
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions bastion/src/bastion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,16 @@ impl Bastion {
}

/// Creates a new [`Children`], passes it through the specified
/// `init` closure and then sends it to the system's default
/// supervisor for it to start supervising it.
/// `init` closure and then sends it to the system supervisor
/// for it to start supervising it.
///
/// This methods returns a [`ChildrenRef`] referencing the newly
/// created children group it it succeeded, or `Err(())`
/// otherwise.
///
/// Note that the "system supervisor" is a supervisor created
/// by the system at startup.
///
/// # Arguments
///
/// * `init` - The closure taking the new [`Children`] as an
Expand Down
4 changes: 2 additions & 2 deletions bastion/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ impl BastionContext {

/// Returns a [`SupervisorRef`] referencing the supervisor
/// that supervises the element that is linked to this
/// `BastionContext` if it isn't the system's supervisor
/// (if the children group wasn't created using
/// `BastionContext` if it isn't the system supervisor
/// (ie. if the children group wasn't created using
/// [`Bastion::children`]).
///
/// # Example
Expand Down
5 changes: 5 additions & 0 deletions bastion/src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ use std::task::Poll;
/// supervisor will restart it and eventually some of its other
/// supervised entities, depending on its supervision strategy.
///
/// Note that a supervisor, called the "system supervisor", is
/// created by the system at startup and is the supervisor
/// supervising children groups created via [`Bastion::children`].
///
/// # Example
///
/// ```
Expand All @@ -45,6 +49,7 @@ use std::task::Poll;
/// [`Children`]: children/struct.Children.html
/// [`SupervisionStrategy`]: supervisor/enum.SupervisionStrategy.html
/// [`with_strategy`]: #method.with_strategy
/// [`Bastion::children`]: struct.Bastion.html#method.children
pub struct Supervisor {
bcast: Broadcast,
// The order in which children and supervisors were added.
Expand Down

0 comments on commit 134b430

Please sign in to comment.