pub struct SessionLaneQueue { /* private fields */ }Expand description
Per-session command queue backed by a3s-lane with external task handling
Implementations§
Source§impl SessionLaneQueue
impl SessionLaneQueue
Sourcepub async fn new(
session_id: &str,
config: SessionQueueConfig,
event_tx: Sender<AgentEvent>,
) -> Result<Self>
pub async fn new( session_id: &str, config: SessionQueueConfig, event_tx: Sender<AgentEvent>, ) -> Result<Self>
Create a new session lane queue
pub async fn start(&self) -> Result<()>
pub async fn stop(&self)
pub async fn set_lane_handler( &self, lane: SessionLane, config: LaneHandlerConfig, )
pub async fn get_lane_handler(&self, lane: SessionLane) -> LaneHandlerConfig
Sourcepub async fn submit(
&self,
lane: SessionLane,
command: Box<dyn SessionCommand>,
) -> Receiver<Result<Value>>
pub async fn submit( &self, lane: SessionLane, command: Box<dyn SessionCommand>, ) -> Receiver<Result<Value>>
Submit a command to a specific lane
pub async fn submit_by_tool( &self, tool_name: &str, command: Box<dyn SessionCommand>, ) -> Receiver<Result<Value>>
Sourcepub async fn submit_batch(
&self,
lane: SessionLane,
commands: Vec<Box<dyn SessionCommand>>,
) -> Vec<Receiver<Result<Value>>>
pub async fn submit_batch( &self, lane: SessionLane, commands: Vec<Box<dyn SessionCommand>>, ) -> Vec<Receiver<Result<Value>>>
Submit multiple commands to the same lane in batch (optimized)
This is more efficient than calling submit() multiple times because:
- Handler config is fetched only once
- Task IDs are generated in batch
- Reduces lock contention
Sourcepub async fn submit_batch_by_tool(
&self,
tool_name: &str,
commands: Vec<Box<dyn SessionCommand>>,
) -> Vec<Receiver<Result<Value>>>
pub async fn submit_batch_by_tool( &self, tool_name: &str, commands: Vec<Box<dyn SessionCommand>>, ) -> Vec<Receiver<Result<Value>>>
Submit multiple commands by tool name in batch (optimized)
pub async fn complete_external_task( &self, task_id: &str, result: ExternalTaskResult, ) -> bool
pub async fn stats(&self) -> SessionQueueStats
pub async fn pending_external_tasks(&self) -> Vec<ExternalTask>
pub fn session_id(&self) -> &str
Sourcepub fn event_bridge(&self) -> &EventBridge
pub fn event_bridge(&self) -> &EventBridge
Access the event bridge for emitting queue lifecycle events
Sourcepub fn subscribe(&self) -> Receiver<AgentEvent>
pub fn subscribe(&self) -> Receiver<AgentEvent>
Subscribe to queue events (CommandDeadLettered, CommandRetry, QueueAlert, etc.)
pub async fn dead_letters(&self) -> Vec<DeadLetter>
pub async fn metrics_snapshot(&self) -> Option<MetricsSnapshot>
pub async fn drain(&self, timeout: Duration) -> Result<()>
pub fn is_shutting_down(&self) -> bool
Auto Trait Implementations§
impl Freeze for SessionLaneQueue
impl !RefUnwindSafe for SessionLaneQueue
impl Send for SessionLaneQueue
impl Sync for SessionLaneQueue
impl Unpin for SessionLaneQueue
impl UnsafeUnpin for SessionLaneQueue
impl !UnwindSafe for SessionLaneQueue
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