Skip to main content

GraphInner

Struct GraphInner 

Source
pub struct GraphInner {
    pub shared: Arc<GraphShared>,
    /* private fields */
}

Fields§

§shared: Arc<GraphShared>

Implementations§

Source§

impl GraphInner

Source

pub fn add_observer( &self, port: &str, cb: unsafe extern "C" fn(*mut c_void, LMFlowPacket), user: *mut c_void, observe_timestamp_bounds: bool, ) -> Result<()>

Source

pub fn add_observer_fn( &self, port: &str, callback: Arc<dyn Fn(&Packet) + Send + Sync>, observe_timestamp_bounds: bool, ) -> Result<()>

Rust 宿主的推模式订阅。回调在派发该包的线程上执行(可能是池线程), 因此必须 Send + Sync;回调内不得再调 graph 的生命周期接口。

Source

pub fn nodes_len(&self) -> usize

Source

pub fn node_name_at(&self, i: usize) -> Option<&str>

Source

pub fn node_input_ports_len(&self, node: usize) -> usize

Source

pub fn node_input_port_name_at(&self, node: usize, port: usize) -> Option<&str>

Source

pub fn input_port_name_at(&self, i: usize) -> Option<&str>

Source

pub fn output_port_name_at(&self, i: usize) -> Option<&str>

Source

pub fn num_input_ports(&self) -> usize

Source

pub fn num_output_ports(&self) -> usize

Source

pub fn edge_id_by_name(&self, name: &str) -> Option<EdgeId>

Source

pub fn input_edge_by_name(&self, name: &str) -> Option<EdgeId>

Source

pub fn queue_depth_by_name(&self, name: &str) -> Option<usize>

Source

pub fn dropped_by_name(&self, name: &str) -> Option<u64>

Source

pub fn send_by_edge( &self, edge: EdgeId, packet: Packet, blocking: bool, ) -> Result<()>

Source

pub fn close_edge_pub(&self, edge: EdgeId)

Source

pub fn state_pub(&self) -> State

Source

pub fn dump_pub(&self) -> String

Source

pub fn node_stats_pub(&self, i: usize) -> Option<NodeStatsSnapshot>

Source

pub fn side_packets_mut(&self) -> &Mutex<BTreeMap<String, Packet>>

Source

pub fn start_pub(self: &Arc<Self>) -> Result<()>

Source

pub fn wait_done_pub(&self) -> Result<()>

Source

pub fn pump_step_pub(&self) -> bool

Source

pub fn all_nodes_closed_pub(&self) -> bool

Source

pub fn graph_inputs(&self) -> &[EdgeId] ⓘ

Source

pub fn pause(&self)

Source

pub fn resume(&self)

恢复调度,并重扫一遍就绪节点 —— 暂停期间到达的包否则会一直躺着。

Source

pub fn is_paused(&self) -> bool

Source

pub fn executor_names(&self) -> Vec<&str>

Source§

impl GraphInner

Source

pub fn to_chrome_trace(&self) -> String

导出当前 trace 环内容为 Chrome Trace Event Format 的 JSON(chrome://tracing / perfetto 可直接打开)。未开启 trace(trace_capacity == 0)时返回一个合法的空 trace({"traceEvents":[],...})。多次调用返回环的当前快照,互不影响。

Source§

impl GraphInner

Source

pub fn run_node_on_worker(&self, n: NodeId)

线程池工作线程的入口。

Source

pub fn wake_source_on_worker(&self, n: NodeId, generation: u64)

线程池延迟任务入口:只有当前代次的等待 Source 会被重新放行。

Source

pub fn executor_task_completed(&self)

Trait Implementations§

Source§

impl Drop for GraphInner

Source§

fn drop(&mut self)

兜底关流:图被直接丢弃(没走 wait_done)时,已 open 的算子仍必须收到 Close, 否则算子里申请的资源(文件、连接、GPU 上下文)不会被释放。

Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.