Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top