microde-application 0.4.0

Composition and lifecycle runtime for modular Microde applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::sync::Arc;

use crate::{MicrodeError, MicrodeStopRequest};

/// Operations exposed by a application to its installed modules.
pub trait MicrodeContext: Send + Sync {
    /// Requests an orderly stop and returns without waiting for lifecycle completion.
    fn request_stop(&self, request: MicrodeStopRequest);

    /// Terminates execution immediately, bypassing the orderly shutdown lifecycle.
    fn panic(&self, error: Option<MicrodeError>) -> !;
}

/// An independently owned module-facing context.
pub type MicrodeContextHandle = Arc<dyn MicrodeContext>;