- def cancel(self):
- status = native_bt.graph_cancel(self._ptr)
- utils._handle_func_status(status, 'cannot cancel graph object')
-
- @property
- def is_canceled(self):
- is_canceled = native_bt.graph_is_canceled(self._ptr)
- assert is_canceled >= 0
- return is_canceled > 0
-
- def create_output_port_message_iterator(self, output_port):
- utils._check_type(output_port, bt2.port._OutputPort)
- msg_iter_ptr = native_bt.port_output_message_iterator_create(
- self._ptr, output_port._ptr
- )
-
- if msg_iter_ptr is None:
- raise bt2.CreationError('cannot create output port message iterator')
+ def add_interrupter(self, interrupter):
+ utils._check_type(interrupter, bt2_interrupter.Interrupter)
+ native_bt.graph_add_interrupter(self._ptr, interrupter._ptr)