mirror of
https://git.kore.io/kore.git
synced 2024-11-12 05:10:48 +01:00
2c88bc6120
This commit adds the CURL=1 build option. When enabled allows you to schedule CURL easy handles onto the Kore event loop. It also adds an easy to use HTTP client API that abstracts away the settings required from libcurl to make HTTP requests. Tied together with HTTP request state machines this means you can write fully asynchronous HTTP client requests in an easy way. Additionally this exposes that API to the Python code as well allowing you do to things like: client = kore.httpclient("https://kore.io") status, body = await client.get() Introduces 2 configuration options: - curl_recv_max Max incoming bytes for a response. - curl_timeout Timeout in seconds before a transfer is cancelled. This API also allows you to take the CURL easy handle and send emails with it, run FTP, etc. All asynchronously. |
||
---|---|---|
.. | ||
conf | ||
src | ||
.gitignore | ||
README.md |
Kore python async/await examples.
This example also shows off the asynchronous HTTP client support and requires libcurl on your machine.
Run:
$ kodev run
Test:
$ curl -k http://127.0.0.1:8888/queue
$ curl -k http://127.0.0.1:8888/lock
$ curl -k http://127.0.0.1:8888/proc
$ curl -k http://127.0.0.1:8888/socket
$ curl -k http://127.0.0.1:8888/httpclient