Make streams system

This commit is contained in:
Michael Mikovsky
2025-11-25 17:31:09 -07:00
parent 6863e08a0a
commit b43f2f5181
10 changed files with 395 additions and 202 deletions
+8 -1
View File
@@ -11,10 +11,15 @@ mod components;
pub use components::get_components;
mod announcement;
use std::fmt::{self, Debug};
use std::{
fmt::{self, Debug},
sync::{Arc, Mutex},
};
pub use announcement::Announcement;
use crate::module::Manager;
///Generic error type for module-related operations.
#[derive(Debug)]
pub enum ModuleError {
@@ -47,6 +52,8 @@ impl fmt::Display for ModuleError {
/// Trait for defining modules that have a runtime.
pub trait ModuleRuntime: Send + Sync {
fn init(&mut self, manager: Arc<Mutex<Manager>>) -> Result<(), ModuleError>;
/// Returns true if the module is running.
/// After returning false, the module will be dropped.
fn is_running(&self) -> bool;