promise and generator-based coroutines