wrap generator event callbacks in `co` method