kore-doc

The kore documentation found under https://docs.kore.io/
Commits | Files | Refs | README | git clone https://git.kore.io/kore-doc.git

commit 666aec7eaacc3539a98c707bb7254a3ce59ce0d1
parent e9bc46eccad8320161a14ae41df6a43dc2703ea3
Author: Joris Vink <joris@coders.se>
Date:   Mon, 31 Aug 2020 13:58:23 +0200

add missing items

Diffstat:
api/python.md | 110++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 106 insertions(+), 4 deletions(-)

diff --git a/api/python.md b/api/python.md @@ -77,10 +77,10 @@ koreapp = MyApp() * [dbsetup](#dbsetup) * [dbquery](#dbquery) * [websocket\_broadcast](#websocketbroadcast) - * [worker](#worker) TODO - * [setname](#setname) TODO - * [coroname](#coroname) TODO - * [corotrace](#corotrace) TODO + * [worker](#worker) + * [setname](#setname) + * [coroname](#coroname) + * [corotrace](#corotrace) * [Http module](#httpmodule) @@ -936,6 +936,108 @@ def onmessage(c, op, data): --- +# worker {#worker} + +### Synopsis + +```python +kore.worker() +``` + +### Description + +Returns the worker ID the code is currently running under. + +### Returns + +The worker ID. + +### Example + +```python +kore.log(kore.LOG_INFO, "running on %d" % kore.worker()) +``` + +--- + +# setname {#setname} + +### Synopsis + +```python +kore.setname(name) +``` + +### Description + +Sets the kore\_progname variable which is used when constructing +proctitle. + +### Returns + +Nothing + +### Example + +```python +kore.setname("myapp") +``` + +--- + +# coroname {#coroname} + +### Synopsis + +```python +kore.coroname(name) +``` + +### Description + +Sets the current coroutine its friendly name. This name is used when +coroutine tracing is enabled in its output. + +### Returns + +Nothing + +### Example + +```python +kore.coroname("consumer") +``` + +--- + +# corotrace {#corotrace} + +### Synopsis + +```python +kore.corotrace(enabled) +``` + +### Description + +Enables or disable coroutine tracing. + +If enabled the application will print out all coroutines their +suspend / resume activities and where in the Python code this +is happening. + +### Returns + +Nothing + +### Example + +```python +kore.corotrace(True) +``` + +--- + # HTTP {#httpmodule}