()
| 7 | return "foobar" |
| 8 | |
| 9 | async def use_cpp(): |
| 10 | #test awaiting C++ primitives |
| 11 | |
| 12 | async for item in boost_async_example_python.test_generator(): |
| 13 | print("Cpp generator", item) |
| 14 | |
| 15 | print("Cpp promise gave us", await boost_async_example_python.test_promise()) |
| 16 | |
| 17 | # having C++ await our python coros |
| 18 | await boost_async_example_python.test_py_promise(my_cor()) |
| 19 | |
| 20 | |
| 21 | asyncio.run(use_cpp()) |