Skip to content

Async embedded #447

@nickheyer

Description

@nickheyer

Feature Description

Currently facing an issue where running duckscript via duckscript::runner::run_script doesn't leave me a with a way to exit/abort from unfinished script execution. The invoked script will simply continue executing in the background (running in a task::spawn_blocking). I've tried a few different work arounds, and was able to kill my readers/writers attached to the Env, but not the actual script execution.

Describe The Solution You'd Like

r = range 1 5
for x in ${r}
    echo "Iteration ${x}"
    sleep 1000
end

Would output:

Iteration 1
Iteration 2
Iteration 3 # <- I want to be able to terminate the script execution here from Rust
Iteration 4
Iteration 5 
# <- It currently terminates here

I think adding some type of method that I could call from the main thread to terminate the execution without exiting the entire program would be great (im running a ui on top of the interpreter).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions