├── .gitignore ├── 01.intro.cpp ├── 02.sequence.cpp ├── 02.sequence_2.cpp ├── 03.functional.cpp ├── 04.task ├── CMakeLists.txt ├── Result.h ├── Task.h ├── TaskAwaiter.h ├── TaskPromise.h ├── coroutine_common.h ├── io_utils.cpp ├── io_utils.h └── main.cpp ├── 05.dispatcher ├── CMakeLists.txt ├── DispatchAwaiter.h ├── Executor.h ├── Result.h ├── Scheduler.h ├── Task.h ├── TaskAwaiter.h ├── TaskPromise.h ├── coroutine_common.h ├── io_utils.cpp ├── io_utils.h └── main.cpp ├── 06.sleep ├── CMakeLists.txt ├── DispatchAwaiter.h ├── Executor.h ├── Result.h ├── Scheduler.h ├── SleepAwaiter.h ├── Task.h ├── TaskAwaiter.h ├── TaskPromise.h ├── coroutine_common.h ├── io_utils.cpp ├── io_utils.h └── main.cpp ├── 07.channel ├── CMakeLists.txt ├── Channel.h ├── ChannelAwaiter.h ├── DispatchAwaiter.h ├── Executor.h ├── Result.h ├── Scheduler.h ├── SleepAwaiter.h ├── Task.h ├── TaskAwaiter.h ├── TaskPromise.h ├── coroutine_common.h ├── io_utils.cpp ├── io_utils.h └── main.cpp ├── 08.awaiter ├── CMakeLists.txt ├── Channel.h ├── ChannelAwaiter.h ├── CommonAwaiter.h ├── DispatchAwaiter.h ├── Executor.h ├── FutureAwaiter.h ├── Result.h ├── Scheduler.h ├── SleepAwaiter.h ├── Task.h ├── TaskAwaiter.h ├── TaskPromise.h ├── coroutine_common.h ├── io_utils.cpp ├── io_utils.h └── main.cpp ├── 09.http ├── CMakeLists.txt ├── Channel.h ├── ChannelAwaiter.h ├── CommonAwaiter.h ├── DispatchAwaiter.h ├── Executor.h ├── FutureAwaiter.h ├── Result.h ├── Scheduler.h ├── SleepAwaiter.h ├── Task.h ├── TaskAwaiter.h ├── TaskPromise.h ├── conanfile.txt ├── coroutine_common.h ├── io_utils.cpp ├── io_utils.h └── main.cpp ├── CMakeLists.txt ├── README.md └── io.h /.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build* 2 | *.iml 3 | .idea -------------------------------------------------------------------------------- /01.intro.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/01.intro.cpp -------------------------------------------------------------------------------- /02.sequence.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/02.sequence.cpp -------------------------------------------------------------------------------- /02.sequence_2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/02.sequence_2.cpp -------------------------------------------------------------------------------- /03.functional.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/03.functional.cpp -------------------------------------------------------------------------------- /04.task/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/CMakeLists.txt -------------------------------------------------------------------------------- /04.task/Result.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/Result.h -------------------------------------------------------------------------------- /04.task/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/Task.h -------------------------------------------------------------------------------- /04.task/TaskAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/TaskAwaiter.h -------------------------------------------------------------------------------- /04.task/TaskPromise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/TaskPromise.h -------------------------------------------------------------------------------- /04.task/coroutine_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/coroutine_common.h -------------------------------------------------------------------------------- /04.task/io_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/io_utils.cpp -------------------------------------------------------------------------------- /04.task/io_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/io_utils.h -------------------------------------------------------------------------------- /04.task/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/04.task/main.cpp -------------------------------------------------------------------------------- /05.dispatcher/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/CMakeLists.txt -------------------------------------------------------------------------------- /05.dispatcher/DispatchAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/DispatchAwaiter.h -------------------------------------------------------------------------------- /05.dispatcher/Executor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/Executor.h -------------------------------------------------------------------------------- /05.dispatcher/Result.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/Result.h -------------------------------------------------------------------------------- /05.dispatcher/Scheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/Scheduler.h -------------------------------------------------------------------------------- /05.dispatcher/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/Task.h -------------------------------------------------------------------------------- /05.dispatcher/TaskAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/TaskAwaiter.h -------------------------------------------------------------------------------- /05.dispatcher/TaskPromise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/TaskPromise.h -------------------------------------------------------------------------------- /05.dispatcher/coroutine_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/coroutine_common.h -------------------------------------------------------------------------------- /05.dispatcher/io_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/io_utils.cpp -------------------------------------------------------------------------------- /05.dispatcher/io_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/io_utils.h -------------------------------------------------------------------------------- /05.dispatcher/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/05.dispatcher/main.cpp -------------------------------------------------------------------------------- /06.sleep/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/CMakeLists.txt -------------------------------------------------------------------------------- /06.sleep/DispatchAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/DispatchAwaiter.h -------------------------------------------------------------------------------- /06.sleep/Executor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/Executor.h -------------------------------------------------------------------------------- /06.sleep/Result.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/Result.h -------------------------------------------------------------------------------- /06.sleep/Scheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/Scheduler.h -------------------------------------------------------------------------------- /06.sleep/SleepAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/SleepAwaiter.h -------------------------------------------------------------------------------- /06.sleep/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/Task.h -------------------------------------------------------------------------------- /06.sleep/TaskAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/TaskAwaiter.h -------------------------------------------------------------------------------- /06.sleep/TaskPromise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/TaskPromise.h -------------------------------------------------------------------------------- /06.sleep/coroutine_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/coroutine_common.h -------------------------------------------------------------------------------- /06.sleep/io_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/io_utils.cpp -------------------------------------------------------------------------------- /06.sleep/io_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/io_utils.h -------------------------------------------------------------------------------- /06.sleep/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/06.sleep/main.cpp -------------------------------------------------------------------------------- /07.channel/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/CMakeLists.txt -------------------------------------------------------------------------------- /07.channel/Channel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/Channel.h -------------------------------------------------------------------------------- /07.channel/ChannelAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/ChannelAwaiter.h -------------------------------------------------------------------------------- /07.channel/DispatchAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/DispatchAwaiter.h -------------------------------------------------------------------------------- /07.channel/Executor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/Executor.h -------------------------------------------------------------------------------- /07.channel/Result.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/Result.h -------------------------------------------------------------------------------- /07.channel/Scheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/Scheduler.h -------------------------------------------------------------------------------- /07.channel/SleepAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/SleepAwaiter.h -------------------------------------------------------------------------------- /07.channel/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/Task.h -------------------------------------------------------------------------------- /07.channel/TaskAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/TaskAwaiter.h -------------------------------------------------------------------------------- /07.channel/TaskPromise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/TaskPromise.h -------------------------------------------------------------------------------- /07.channel/coroutine_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/coroutine_common.h -------------------------------------------------------------------------------- /07.channel/io_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/io_utils.cpp -------------------------------------------------------------------------------- /07.channel/io_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/io_utils.h -------------------------------------------------------------------------------- /07.channel/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/07.channel/main.cpp -------------------------------------------------------------------------------- /08.awaiter/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/CMakeLists.txt -------------------------------------------------------------------------------- /08.awaiter/Channel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/Channel.h -------------------------------------------------------------------------------- /08.awaiter/ChannelAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/ChannelAwaiter.h -------------------------------------------------------------------------------- /08.awaiter/CommonAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/CommonAwaiter.h -------------------------------------------------------------------------------- /08.awaiter/DispatchAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/DispatchAwaiter.h -------------------------------------------------------------------------------- /08.awaiter/Executor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/Executor.h -------------------------------------------------------------------------------- /08.awaiter/FutureAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/FutureAwaiter.h -------------------------------------------------------------------------------- /08.awaiter/Result.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/Result.h -------------------------------------------------------------------------------- /08.awaiter/Scheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/Scheduler.h -------------------------------------------------------------------------------- /08.awaiter/SleepAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/SleepAwaiter.h -------------------------------------------------------------------------------- /08.awaiter/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/Task.h -------------------------------------------------------------------------------- /08.awaiter/TaskAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/TaskAwaiter.h -------------------------------------------------------------------------------- /08.awaiter/TaskPromise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/TaskPromise.h -------------------------------------------------------------------------------- /08.awaiter/coroutine_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/coroutine_common.h -------------------------------------------------------------------------------- /08.awaiter/io_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/io_utils.cpp -------------------------------------------------------------------------------- /08.awaiter/io_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/io_utils.h -------------------------------------------------------------------------------- /08.awaiter/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/08.awaiter/main.cpp -------------------------------------------------------------------------------- /09.http/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/CMakeLists.txt -------------------------------------------------------------------------------- /09.http/Channel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/Channel.h -------------------------------------------------------------------------------- /09.http/ChannelAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/ChannelAwaiter.h -------------------------------------------------------------------------------- /09.http/CommonAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/CommonAwaiter.h -------------------------------------------------------------------------------- /09.http/DispatchAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/DispatchAwaiter.h -------------------------------------------------------------------------------- /09.http/Executor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/Executor.h -------------------------------------------------------------------------------- /09.http/FutureAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/FutureAwaiter.h -------------------------------------------------------------------------------- /09.http/Result.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/Result.h -------------------------------------------------------------------------------- /09.http/Scheduler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/Scheduler.h -------------------------------------------------------------------------------- /09.http/SleepAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/SleepAwaiter.h -------------------------------------------------------------------------------- /09.http/Task.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/Task.h -------------------------------------------------------------------------------- /09.http/TaskAwaiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/TaskAwaiter.h -------------------------------------------------------------------------------- /09.http/TaskPromise.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/TaskPromise.h -------------------------------------------------------------------------------- /09.http/conanfile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/conanfile.txt -------------------------------------------------------------------------------- /09.http/coroutine_common.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/coroutine_common.h -------------------------------------------------------------------------------- /09.http/io_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/io_utils.cpp -------------------------------------------------------------------------------- /09.http/io_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/io_utils.h -------------------------------------------------------------------------------- /09.http/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/09.http/main.cpp -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/README.md -------------------------------------------------------------------------------- /io.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bennyhuo/CppCoroutines/HEAD/io.h --------------------------------------------------------------------------------