pub struct CallbackHandlerAdapter { /* private fields */ }Expand description
Adapter that wraps any GraphCallbackHandler and implements
juncture_core::observability::GraphLifecycleCallback.
Use CallbackHandlerAdapter::new to create an instance, then pass the
resulting Arc<CallbackHandlerAdapter> to
RunnableConfig::with_callback_handler.
§Examples
ⓘ
use std::sync::Arc;
use juncture_tracing::callback::{CallbackHandlerAdapter, GraphCallbackHandler};
use juncture_core::config::RunnableConfig;
struct MyHandler;
impl GraphCallbackHandler for MyHandler {}
let handler = Arc::new(MyHandler);
let adapter = CallbackHandlerAdapter::new(handler);
let config = RunnableConfig::new()
.with_callback_handler(adapter);Implementations§
Source§impl CallbackHandlerAdapter
impl CallbackHandlerAdapter
Sourcepub fn new(handler: Arc<dyn GraphCallbackHandler>) -> Self
pub fn new(handler: Arc<dyn GraphCallbackHandler>) -> Self
Create a new adapter wrapping the given GraphCallbackHandler.
Trait Implementations§
Source§impl Debug for CallbackHandlerAdapter
impl Debug for CallbackHandlerAdapter
Source§impl GraphLifecycleCallback for CallbackHandlerAdapter
impl GraphLifecycleCallback for CallbackHandlerAdapter
Source§fn on_node_start(&self, node: &str, task_id: &str)
fn on_node_start(&self, node: &str, task_id: &str)
Called when a node starts execution.
Source§fn on_node_end(&self, node: &str, task_id: &str, duration_ms: u64)
fn on_node_end(&self, node: &str, task_id: &str, duration_ms: u64)
Called when a node completes execution successfully.
Source§fn on_node_error(&self, node: &str, error: &JunctureError)
fn on_node_error(&self, node: &str, error: &JunctureError)
Called when a node encounters an error.
Source§fn on_graph_end(&self, result: &Result<(), JunctureError>)
fn on_graph_end(&self, result: &Result<(), JunctureError>)
Called when the graph execution completes.
Source§fn on_checkpoint_saved(&self, checkpoint_id: &str, step: usize)
fn on_checkpoint_saved(&self, checkpoint_id: &str, step: usize)
Called when a checkpoint is saved.
Auto Trait Implementations§
impl !RefUnwindSafe for CallbackHandlerAdapter
impl !UnwindSafe for CallbackHandlerAdapter
impl Freeze for CallbackHandlerAdapter
impl Send for CallbackHandlerAdapter
impl Sync for CallbackHandlerAdapter
impl Unpin for CallbackHandlerAdapter
impl UnsafeUnpin for CallbackHandlerAdapter
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