pub struct App { /* private fields */ }Expand description
An app: one service made of whole domains, for Kernable::app. Every aggregate, read
model and reactor created through its domains runs in it. Built with methods that each
return the changed app:
let app = kernable.app(App::new().service("shop").version("1.0.0").domain(&shop_domain))?;
then app.run().await?. To do something once everything is connected (e.g. in a test),
spawn it and wait: let running = tokio::spawn({ let app = app.clone(); async move { app.run().await } }); app.ready().await;.
Implementations§
Source§impl App
impl App
Sourcepub fn new() -> App
pub fn new() -> App
An app without domains for the connection’s service; add them with App::domain.
Sourcepub fn service(self, service: impl Into<String>) -> App
pub fn service(self, service: impl Into<String>) -> App
The service it is. Default: the connection’s (crate::Options::service).
Sourcepub fn version(self, version: impl Into<String>) -> App
pub fn version(self, version: impl Into<String>) -> App
Goes into the membership’s metadata as version.
Sourcepub fn description(self, description: impl Into<String>) -> App
pub fn description(self, description: impl Into<String>) -> App
Goes into the membership’s metadata as description.
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> App
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> App
More metadata, after version and description; kept in the order given.
Sourcepub fn domain(self, domain: &Domain) -> App
pub fn domain(self, domain: &Domain) -> App
A domain of the app: its aggregates, read models and reactors run in it. Call it once per domain.
Sourcepub fn switch(self, switch: Switch) -> App
pub fn switch(self, switch: Switch) -> App
When the app’s deployment takes the service over from another one that serves it (see
Switch): by default once its read models have caught up, if the deployment never
served before; meanwhile it runs beside the serving deployment, its workers idle and its
read models building. One that served before (an older deployment’s app restarting) runs
beside until an operator rolls back. Default:
KERNABLE_SWITCH (caught-up, now, never), else Switch::CaughtUp.
Trait Implementations§
Auto Trait Implementations§
impl Forget for App
impl Freeze for App
impl Move for App
impl RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl UnwindSafe for App
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request