in reply to AnyEvent code blocking Twiggy event loop
AE/Twiggi do not introduce any "magic": if your code is blocking and long-running, they "hang", just because that code is running. (Well, that's why there is workers: while one is blocked, some other could serve other clients meanwhile).
Now, to your problem with executing external programs: try to execute it via AnyEvent::Util::fork_call, which executes program asynchronously without blocking main execution thread. Then in forked child you can use backticks to get the result, transform it, and return to main execution process (worker).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: AnyEvent code blocking Twiggy event loop
by Anonymous Monk on Apr 27, 2015 at 20:18 UTC | |
by basiliscos (Pilgrim) on Apr 27, 2015 at 23:26 UTC | |
by Anonymous Monk on Apr 27, 2015 at 23:06 UTC |