RuleScript v1.10.0-rc1.3
Pre-release
Pre-release
RuleScript v1.10.0-rc1.3
RuleScript v1.10.0-rc1.3 fixes HostTrigger runtime lifetime behavior after dispatching a trigger request.
Runtime Lifetime After Dispatch
trigger task dispatchers now keep the runtime alive after handling a host trigger request. A dispatcher that waits on dispatch; continues waiting for the next request instead of allowing the runtime to complete after one trigger.
parallel:
trigger task:
dispatch;
end
end
@HostTrigger("HostPrint")
function HostPrint(msg: string):
Print(msg);
end
var runtime = engine.CreateRuntime(script);
var running = runtime.StartAsync();
await runtime.TriggerAsync("HostPrint", ["hello"]);
Console.WriteLine(runtime.State); // Running
await runtime.TriggerAsync("HostPrint", ["again"]);
await runtime.StopAsync();
await running;Host Function Calls From HostTrigger Handlers
HostTrigger handlers are still executed by the interpreter, but they are no longer treated like ordinary parallel task bodies for host-function thread-safety checks. This prevents a handler such as HostPrint from faulting the trigger dispatcher solely because it calls a regular host function like Print.
Normal task: blocks keep the existing thread-safety protection.
Compatibility Notes
- Existing
parallel,task, andtrigger tasksyntax is unchanged. - Existing HostTrigger enqueue and FIFO behavior is unchanged.
- HostTrigger handler execution remains interpreter-owned; host threads still enqueue requests instead of directly invoking user functions.
StopAsyncremains the expected way to end a long-running trigger runtime.
Validation
This release candidate is covered by tests for:
- dispatching a host trigger request without completing the runtime
- using
endblock terminators withtrigger task - calling a non-thread-safe host function from a HostTrigger handler
- existing HostTrigger FIFO behavior
- full regression coverage