Commit Graph

82 Commits

Author SHA1 Message Date
Martin Chang
8bd1f5684e
Fix drogon::Task<> not destructing internal object (#729) 2021-03-01 13:36:03 +08:00
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
An Tao
0fe3f6fd8f
Use explicit lambda capture lists (#590) 2020-10-02 11:45:07 +08:00
An Tao
4c9463eeb7
Modify session handling (#568)
* Change thread unsafe interfaces to safe.

* Fix some compiler warnings
2020-09-15 08:28:04 +08:00
An Tao
ecb3d3f74f
Make app().run() method callable on a non-main thread (#457) 2020-06-06 12:24:06 +08:00
An Tao
58702dc41e
Port drogon to Windows (#335)
Co-authored-by: mcirsta <mforce2@gmail.com>
2020-01-25 11:58:20 +08:00
An Tao
a67ab1db52
Add some unit tests (#311) 2019-12-09 22:16:09 +08:00
An Tao
40ffb2d2af
Modify some code styles (#298) 2019-11-21 11:27:47 +08:00
Daniel Mensinger
795079531a cmake: use export namespace for Drogon::Drogon (#255)
* cmake: use ${PROJECT_NAME} instead of drogon everywere

* cmake: use export namespace instead of dummy library
2019-09-26 19:33:58 +08:00
An Tao
aa26e9a903
Modify the CMakeLists to modern cmake style (#229) 2019-08-31 08:27:57 +08:00
An Tao
c3cb70f415
Optimize performance (#222) 2019-08-24 13:12:04 +08:00
antao
40087fba9c Remove config.h
Modify the CMakeLists.txt

Remove the USE_ORM macro

Update trantor

Remove some std::dynamic_pointer_cast calls
2019-07-29 14:53:41 +08:00
antao
e714ae875e Use a temporary file instead of memory to store a large Http body recieved by drogon 2019-06-06 14:59:49 +08:00
antao
3452a2fa1c Modify some code to get a good style 2019-05-23 18:57:45 +08:00
antao
fc7505122f Update the submodule trantor 2019-05-23 16:07:08 +08:00
antao
e5fe92c67a Change the line length limit to 80 characters 2019-05-18 11:11:45 +08:00
antao
be08aba9d1 Add .clang-format 2019-05-17 22:49:09 +08:00
antao
e48692939c Modify some interfaces 2019-04-29 14:47:23 +08:00
antao
65c101bee0 Add the getLoop() method to the HttpAppFramework class 2019-03-26 10:45:39 +08:00
antao
db72840fc2 Move utility functions to the utils namespace 2019-03-21 17:47:45 +08:00
an-tao
0e447a1f9e Adapt ipv6 2019-03-13 23:44:53 +08:00
antao
bdcb42ce55 Merge branch 'master' of https://github.com/an-tao/drogon 2019-02-02 13:31:10 +08:00
antao
e77b558a71 Modify urlDecode() method 2019-02-02 13:26:19 +08:00
an-tao
287a7b5208 Add a header including in linux 2019-02-02 12:09:14 +08:00
antao
7041783579 Modify code style 2019-02-02 11:34:00 +08:00
an-tao
cbbee440ea Compatible with older versions of gcc 2019-01-29 22:24:32 +08:00
antao
615924c889 Debug form post request 2019-01-23 11:32:55 +08:00
antao
856aedbf47 Support gzip on the client side 2019-01-21 13:37:53 +08:00
antao
c4591fc11d Remove an unused file 2019-01-20 12:11:39 +08:00
antao
5c9799c15a Modify http client for cookies 2019-01-02 16:13:36 +08:00
antao
fb5bbde277 Modify something to improve performance 2018-12-24 15:06:05 +08:00
antao
20f97a78a2 Modify tests path 2018-11-27 18:29:23 +08:00