You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now, to run script files concurrently, you have to explicitly define which ones you want to run.
If we add an async keyword, it can mark that file should be executed concurrently.
So it could look like this:
async
echo"hello there"
sync echo"hello but synchronous"
But the thing is - that I am not sure how to parse the keyword in the parsing stage. Right now I can think of a special async builtin, which pauses Runner execution, puts it to concurrent mode, and continues from where it stopped but in another goroutine. I assume it to be embedded into Runner.Run(...) function.
So overall execution of two scripts concurrently could look like this:
Main goroutine:
Executing scripts sequentially
Starts executing first script:
echo"hey"
async
sync echo"heey sync"
Prints "hey"
It meets async, runner switches to concurrent mode, resumes execution in another goroutine
As first script is resumed in another goroutine, main goroutine starts parsing the second file:
As of now, to run script files concurrently, you have to explicitly define which ones you want to run.
If we add an
async
keyword, it can mark that file should be executed concurrently.So it could look like this:
But the thing is - that I am not sure how to parse the keyword in the parsing stage. Right now I can think of a special
async
builtin, which pauses Runner execution, puts it to concurrent mode, and continues from where it stopped but in another goroutine. I assume it to be embedded intoRunner.Run(...)
function.So overall execution of two scripts concurrently could look like this:
Main goroutine:
async
, runner switches to concurrent mode, resumes execution in another goroutineasync
builtin again, and does the same thing as with the first script.First goroutine:
Second goroutine:
And as here the number of async workers will dynamically change, the channel which recieves errors in
RunnersManager
could be unbuffered.The text was updated successfully, but these errors were encountered: