Question

i'll try to make my question simple. I have two bashes to run in ubuntu, and their processing rely on each other, like a chess game, or like: bash A: execute a command; and read from stdin bash B: execute a command, print to stdout bash A: continue...

is coroutine in lua able to do stuff like this?

Was it helpful?

Solution

No, coroutine is just cooperative threading within one Lua state, it cannot be used for interprocess communication (although you can do within a coroutine anything that can be done in any regular function, such as reading from stdin, writing to stdout, using io.popen etc, but coroutines are not necessary to do what you want). See the link that Kamiccolo posted in comment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top