1.1 KiB
Architecture
Supervisor runs actors and manages their lifecycle. Additionally supervisor dispatches jobs to actors and provides an API for job supervision. Jobs are dispatched to actors over a redis protocol. Jobs have a script which is the code that is to be executed by the actor. There are two script formats used: Rhai and HeroScript. Jobs also have params such as timeout and priority for job management, and context variables which are available to the script such as CALLER_ID and CONTEXT_ID. There are four different types of actors: OSIS, SAL, V and Python. OSIS and SAL actors use Rhai scripts, while V and Python actors use HeroScript. Each actor has its own queue and is responsible for processing jobs of its type. Each actor has a unique way of executing the script.
The OSIS actor executes non-blocking Rhai scripts one after another using the Rhai engine on a single thread. The SAL actor executes blocking asynchronous Rhai scripts concurrently: it spawns a new thread for each script evaluation. V and Python actors execute HeroScript scripts using a V or Python heroscript engine.