pub struct PersistentSubprocessController {
tab_id: String,
block_id: String,
inner: Arc<Mutex<PersistentInner>>,
broker: Option<Arc<Broker>>,
event_bus: Option<Arc<EventBus>>,
wstore: Option<Arc<WaveStore>>,
filestore: Option<Arc<FileStore>>,
health_monitor: Arc<HealthMonitor>,
}Expand description
PersistentSubprocessController keeps a long-running CLI process alive, sending user messages as NDJSON lines on stdin.
Fields§
§tab_id: String§block_id: String§inner: Arc<Mutex<PersistentInner>>§broker: Option<Arc<Broker>>§event_bus: Option<Arc<EventBus>>§wstore: Option<Arc<WaveStore>>§filestore: Option<Arc<FileStore>>FileStore for write-through persistence of output lines (Phase 1.3).
health_monitor: Arc<HealthMonitor>Implementations§
Source§impl PersistentSubprocessController
impl PersistentSubprocessController
pub fn new( tab_id: String, block_id: String, broker: Option<Arc<Broker>>, event_bus: Option<Arc<EventBus>>, wstore: Option<Arc<WaveStore>>, filestore: Option<Arc<FileStore>>, ) -> Self
fn set_status(inner: &mut PersistentInner, status: &str)
fn get_status_snapshot(&self) -> BlockControllerRuntimeStatus
fn publish_status(&self)
fn is_running(&self) -> bool
Sourcepub fn send_message(
&self,
message: String,
config: PersistentSpawnConfig,
) -> Result<(), String>
pub fn send_message( &self, message: String, config: PersistentSpawnConfig, ) -> Result<(), String>
Send a user message to the running CLI process. If the process isn’t spawned yet, spawns it first.
Sourcefn spawn_process(&self, config: PersistentSpawnConfig) -> Result<(), String>
fn spawn_process(&self, config: PersistentSpawnConfig) -> Result<(), String>
Spawn the persistent CLI process.
pub fn stop_process(&self, force: bool) -> Result<(), String>
pub fn session_id(&self) -> Option<String>
Trait Implementations§
Source§impl Controller for PersistentSubprocessController
impl Controller for PersistentSubprocessController
Source§fn start(
&self,
_block_meta: HashMap<String, Value>,
_rt_opts: Option<Value>,
_force: bool,
) -> Result<(), String>
fn start( &self, _block_meta: HashMap<String, Value>, _rt_opts: Option<Value>, _force: bool, ) -> Result<(), String>
Start the controller. May spawn background tasks.
force restarts even if already running.Source§fn stop(&self, _graceful: bool, new_status: &str) -> Result<(), String>
fn stop(&self, _graceful: bool, new_status: &str) -> Result<(), String>
Stop the controller.
graceful waits for process to exit; new_status is the target state.Source§fn get_runtime_status(&self) -> BlockControllerRuntimeStatus
fn get_runtime_status(&self) -> BlockControllerRuntimeStatus
Get the current runtime status.
Source§fn send_input(
&self,
_input: BlockInputUnion,
_seq: Option<u64>,
) -> Result<(), String>
fn send_input( &self, _input: BlockInputUnion, _seq: Option<u64>, ) -> Result<(), String>
Send input (terminal data, signal, or resize) to the controller.
seq is the per-TermViewModel monotonic counter; None means fire-and-forget (no ordering).Source§fn controller_type(&self) -> &str
fn controller_type(&self) -> &str
Get the controller type (e.g., “shell”, “cmd”).
Auto Trait Implementations§
impl Freeze for PersistentSubprocessController
impl RefUnwindSafe for PersistentSubprocessController
impl Send for PersistentSubprocessController
impl Sync for PersistentSubprocessController
impl Unpin for PersistentSubprocessController
impl UnwindSafe for PersistentSubprocessController
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
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.