Module execute

Module execute 

Source
Expand description

Execution engine for Venus notebooks.

Provides linear, parallel, and process-isolated cell execution with hot-reload support.

§Executors

  • LinearExecutor - In-process sequential execution. Fast but no isolation.
  • ParallelExecutor - In-process parallel execution using Rayon.
  • ProcessExecutor - Process-isolated execution. Cells run in worker processes that can be killed for true interruption. Provides crash isolation, memory isolation, and immediate cancellation.

§Architecture

§In-Process Execution (LinearExecutor, ParallelExecutor)

CompiledCell
    │
    └── LoadedCell (dylib loaded via libloading)
            │
            └── LinearExecutor / ParallelExecutor
                    │
                    └── FFI call → cell entry point
                            │
                            └── Output stored in StateManager

§Process-Isolated Execution (ProcessExecutor)

ProcessExecutor (parent)
    │
    └── WorkerPool
            │
            └── WorkerHandle (manages child process)
                    │
                    ├── IPC: LoadCell command
                    │       └── venus-worker loads dylib
                    │
                    ├── IPC: Execute command
                    │       └── venus-worker calls FFI
                    │       └── Returns serialized output
                    │
                    └── SIGKILL for immediate interruption

§Module Structure

  • context - Execution callbacks and cell context
  • executor - LinearExecutor for sequential execution
  • ffi - FFI types and dispatch macros
  • loaded_cell - LoadedCell wrapper for dylibs
  • parallel - ParallelExecutor for concurrent execution
  • process - ProcessExecutor for isolated execution
  • reload - Hot-reload support
  • windows_dll - Windows DLL hot-reload handler

Structs§

AbortHandle
Handle for cooperative cancellation of cell execution.
CellContext
Execution context for a running cell.
ExecutorKillHandle
Thread-safe handle for killing an executor’s current cell from another thread.
HotReloader
Manages hot reloading of cells.
LinearExecutor
Linear executor that runs cells sequentially in dependency order.
LoadedCell
A loaded cell library ready for execution.
ParallelExecutor
Parallel executor that runs independent cells concurrently.
ProcessExecutor
Process-based executor that runs cells in isolated worker processes.
WindowsDllHandler
Handler for Windows DLL hot-reload.

Enums§

ExecutionResult
Result code from cell execution.

Traits§

ExecutionCallback
Callback trait for execution progress reporting.