NativeIsolateBindingsImpl class

Real NativeIsolateBindings implementation backed by a background Isolate.

Spawns a same-group Isolate that creates a MontyFfi with NativeBindingsFfi. Communication uses sealed _Request/_Response classes sent directly (no JSON encoding needed for same-group isolates).

The native library is resolved automatically by the Dart native assets system via @Native annotations — no manual path is needed.

Inheritance

Constructors

NativeIsolateBindingsImpl({Duration? initTimeout})
Creates a NativeIsolateBindingsImpl.

Properties

handleId int?
The handle ID for cross-isolate cancel, or null if not yet available.
no setter
hashCode int
The hash code for this object.
no setterinherited
initTimeout Duration?
Timeout for the worker isolate to send _ReadyMessage during init. Defaults to 30 seconds if not provided.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel() Future<void>
Cancel the current execution via cancelById (cross-isolate safe).
dispose() Future<void>
Disposes the background Isolate and frees resources.
override
init() Future<bool>
Initializes the background Isolate.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveFutures(Map<int, Object?> results, {Map<int, String>? errors}) Future<MontyProgress>
Resolves one or more pending futures with their results, and optionally errors.
override
restore(Uint8List data) Future<void>
Restores interpreter state from snapshot data.
override
resume(Object? returnValue) Future<MontyProgress>
Resumes a paused execution with returnValue.
override
resumeAsFuture() Future<MontyProgress>
Converts the current pending call into a future and continues execution.
override
resumeWithError(String errorMessage) Future<MontyProgress>
Resumes a paused execution by raising an error with errorMessage.
override
run(String code, {MontyLimits? limits, String? scriptName}) Future<MontyResult>
Runs Python code to completion in the background Isolate.
override
snapshot() Future<Uint8List>
Captures the current interpreter state as a binary snapshot.
override
start(String code, {List<String>? externalFunctions, MontyLimits? limits, String? scriptName}) Future<MontyProgress>
Starts iterative execution of code in the background Isolate.
override
terminate() Future<void>
Cancel and force-kill the worker isolate.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

zombieCount int
The number of zombie worker isolates observed so far.
no setter