drogon/examples/simple_example_test
Martin Chang a2142dd93e
Coroutine support (#693)
* app().registerHttpHandler() accepts coroutine as handlers
* HttpController can use coroutine as handlers'
* Http request handlers with coroutine catches exception instead of crashing the entire app
* DbClient now has execSqlCoro that is awaitable
* DbClient now has newTransactionCoro that is awaitable
* HttpClient have awaitable sendRequestCoro
* WebSocketClient have awaitable connectToServerCoro
* WebSocketClient have setAsyncMessageHandler and setAsyncConnectionClosedHandler
* drogon::AsyncTask and drogon::Task<T> as our corutine types
* Related tests
* Misc

Future work
* Coroutine for WebSocket server
* Known issues

co_future() and sync_wait may crash. It looks like GCC bug but I'm not sure.
Workarround: Make an coroutine of AsyncTask. Then launch said coroutine.
Not sure why wrapping the exact same thing in function crashes things.

Co-authored-by: an-tao <antao2002@gmail.com>
2021-02-06 17:05:58 +08:00
..
HttpPipeliningTest.cc Port drogon to Windows (#335) 2020-01-25 11:58:20 +08:00
main.cc Coroutine support (#693) 2021-02-06 17:05:58 +08:00
MultipleWsTest.cc Modify some code styles (#298) 2019-11-21 11:27:47 +08:00
WebSocketCoroTest.cc Coroutine support (#693) 2021-02-06 17:05:58 +08:00
WebSocketTest.cc Add the Host and Sec-WebSocket-Version headers when connecting to a websocket server (#615) 2020-10-25 08:36:40 +08:00
ws_test.html Modify the WebSocketTest controller to create a simple chat room (#625) 2020-11-14 11:48:40 +08:00