View Source cure_fsm_builtins (cure v0.7.0)
Cure Programming Language - FSM Built-in Functions
This module provides built-in FSM functions that interface directly with the cure_fsm_runtime module. These functions are called from Cure programs via the FFI (Foreign Function Interface) to provide FSM functionality.
Features
FSM Lifecycle Management
- FSM Spawning: Create new FSM instances with type validation
- FSM Termination: Graceful shutdown of FSM processes
FSM Operations
- Event Sending: Asynchronous event dispatch to FSMs
- State Inspection: Query current FSM state and information
- Batch Operations: Efficient batch event processing
FSM Utilities
- Process Monitoring: Monitor FSM processes for termination
- Process Linking: Bidirectional crash propagation
- Timeout Management: Set and clear FSM timeouts
API Design
All functions are designed to be called from Cure programs via FFI. They provide a clean interface to the underlying Erlang FSM runtime.