implication of nesting coroutines
Michael Fung
mike at 3open.org
Sat Jul 6 05:58:44 CEST 2013
Hi Marc,
I want to use MongoDB::Async, which claims: "This driver uses Coro and
EV. It switches to another Coro thread while waiting response from server."
If I use it like that:
[code]
# coro thread to read database per user request
async {
while (1) {
...
my $wait_user_request = AnyEvent->io(
...
cb => rouse_cb
);
$res = rouse_wait;
# Use MongoDB::Async here to read database ...
...
}
}
[/code]
So, this means nesting coroutines, right? If yes, is it bad practice?
Rgds,
Michael
More information about the anyevent
mailing list