drogon/examples
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
..
benchmark Port drogon to Windows (#335) 2020-01-25 11:58:20 +08:00
client_example Properly handle chunked encoding requests. (#479) 2020-06-16 20:36:31 +08:00
simple_example Coroutine support (#693) 2021-02-06 17:05:58 +08:00
simple_example_test Coroutine support (#693) 2021-02-06 17:05:58 +08:00
simple_reverse_proxy Fix an issue of simple_reverse_proxy when handling chunked transfer-e… (#549) 2020-08-25 08:07:43 +08:00
CMakeLists.txt Coroutine support (#693) 2021-02-06 17:05:58 +08:00
README.md Modify dynamic view loading algorithm (#339) 2020-02-16 17:19:16 +08:00

Drogon Examples

The following examples can help you understand how to use Drogon:

  1. benchmark - Basic benchmark example. see wiki benchmarks
  2. client_example - A client example.
  3. simple_example - A simple example showing how to create a web application using Drogon.
  4. simple_example_test - Some tests for the simple_example.
  5. simple_reverse_proxy - A Example showing how to use drogon as a http reverse proxy with a simple round robin.

TechEmpower Framework Benchmarks test suite

I created a benchmark suite for the tfb, see here for details.

Another test suite

I also created a test suite for another web frameworks benchmark repository, see here, in this project, drogon is used as a sub-module (locally include in the project).