#[vlib_process_node]Expand description
Registers a VPP async process node
Creates a process node that runs an async coroutine, integrated with VPP’s event-driven processing model.
§Attributes
name: (required, string literal) The name of the process nodeinstance: (required, ident) The instance of the node.runtime_data_default: (optional, ident) An identifier for a constant value of typeNode::RuntimeDatato use as the default runtime data for this node.log2_stack_bytes: (optional, integer literal) Log2 of process stack size in bytes. Defaults to 0. The value will be set to a minimum value by VPP if smaller.
§Examples
static EXAMPLE_PROCESS_NODE: ExampleProcessNode = ExampleProcessNode::new();
#[vlib_process_node(
name = "example-process",
instance = EXAMPLE_PROCESS_NODE,
)]
struct ExampleProcessNode;
impl ExampleProcessNode {
const fn new() -> Self {
Self
}
}
impl vlib::ProcessNode for ExampleProcessNode {
type NextNodes = ExampleProcessNextNode;
type RuntimeData = ();
type Errors = ExampleProcessErrorCounter;
async fn function(&self, vm: &mut vlib::MainRef, node: &mut vlib::NodeRuntimeRef<Self>) {
todo!()
}
}