capitan-lib

Crates.iocapitan-lib
lib.rscapitan-lib
version0.3.0
sourcesrc
created_at2021-03-29 10:09:28.779652
updated_at2021-04-20 03:39:51.265083
descriptionCAPITAN | Supervisor tree library Capitan allows you to create and configure services and supervisor trees through reactors and services.
homepage
repositoryhttps://github.com/znx3p0/capitan-lib
max_upload_size
id375090
size15,771
(znx3p0)

documentation

https://docs.rs/capitan-lib/

README

CAPITAN

Service library

Capitan allows you to create and configure services and supervisor trees through reactors and services.

There are various concepts you have to understand before building supervisor trees with capitan, since capitan's take on supervisor trees is different from Erlang's take.

Concepts:

  • Reactors
    • Isolated
    • Shared
    • Dynamic
  • Services
    • Isolated
    • Shared
    • Dynamic

Services

Services are structures that implement the service trait. Services can be isolated or shared, but they can also be dynamic.

  • Isolated

    • Isolated services offer a mutable reference to self, that's why they cannot safely be accessed from outside. They are useful for services which operate on singletons, or services that don't need any interaction.
  • Shared

    • Shared services offer a reference to self. They are useful for services which need outside interaction, such as monitoring services.
  • Dynamic

    • Dynamic services can be either isolated or shared services, the difference between dynamic and normal services is that dynamic services can be run on dynamic reactors. Normal reactors have to run the same exact service, so running different services on the same reactor requires the reactor to be dynamic.

Reactors

Reactors are structures which hold and run services.

  • Isolated

    • Isolated reactors run isolated services. They do not offer outside access to their services.
  • Shared

    • Shared reactors run shared services. They offer outside access to their inner services.
  • Dynamic

    • Dynamic reactors run dynamic services. They can either be dynamic shared services or isolated shared services, but never both.
Commit count: 23

cargo fmt