abs-lang / abs

Home of the ABS programming language: the joy of shell scripting.
https://www.abs-lang.org
MIT License
516 stars 35 forks source link

How best to implement parallel shell commands? #457

Closed circular closed 3 years ago

circular commented 3 years ago

I'm working on an ABS script to check on website status codes via curl. So far it works great, though one laggy website can block the entire process.

Is there a recommended way to parallelize this type of activity, so that results are reported as they come in, rather than linearly? Thank you.

odino commented 3 years ago

would this work for the time being?

https://www.abs-lang.org/syntax/system-commands/#executing-commands-in-background

Native concurrency through goroutines is been on the back of my mind for a while -- I just haven't been able to think about the ergonomics for developers eg. how do you trigger a background function etc etc.

circular commented 3 years ago

would this work for the time being?

https://www.abs-lang.org/syntax/system-commands/#executing-commands-in-background

That looks really helpful, thank you. I will have a play.

I was reading a little bit about "native concurrency" while trying to figure out how to write this question :-) but it seemed pretty fancy for what I need to do. I think what you've offered in the background command features above ought to be more than enough, given the scope of this project.