implication of nesting coroutines

Michael Fung mike at
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:
# 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 ...

So, this means nesting coroutines, right? If yes, is it bad practice?


More information about the anyevent mailing list