bb_ops/syscalls/triggers/
event_source.rs1use bb_ir::proto::onnx::NodeProto;
11use bb_runtime::atomic::DispatchResult;
12use bb_runtime::bus::OpError;
13use bb_runtime::runtime::RuntimeResourceRef;
14use bb_runtime::slot_value::SlotValue;
15use bb_runtime::syscall::values::TriggerValue;
16
17pub struct EventSourceOp;
19
20pub const DOMAIN: &str = "ai.bytesandbrains.syscall";
22pub const OP_TYPE: &str = "EventSource";
24
25pub fn invoke(
27 _node: &NodeProto,
28 _inputs: &[(&str, &dyn SlotValue)],
29 _ctx: &mut RuntimeResourceRef<'_>,
30) -> Result<DispatchResult, OpError> {
31 Ok(DispatchResult::Immediate(vec![(
32 "event".to_string(),
33 Box::new(TriggerValue),
34 )]))
35}
36
37use bb_runtime::registry::OpRegistration as _BbOpsSyscallReg;
38
39inventory::submit! {
40 _BbOpsSyscallReg {
41 domain: DOMAIN,
42 op_type: OP_TYPE,
43 invoke,
44 kind: bb_runtime::registry::RegistrationKind::Syscall,
45 }
46}