Now invoking from ReadThread returns None instead raising

Lonami 2017-09-23 11:41:23 +02:00
parent 960ba65c10
commit d71467f090

@ -19,11 +19,11 @@ client.remove_update_handler(my_handler)
# handlers = client.list_update_handlers()
```
An update handler is nothing else than a method accepting a single parameter, the update object to be processed. Please **note** that you should only run **short-running operations** here! You won't be able to receive the result of invoking other requests, or even other updates, while an update handler is running.
An update handler is nothing else than a method accepting a single parameter, the update object to be processed. Please **note** that you should only run **short-running operations** here! Any request you try to invoke from within these will `return None` so the operation ends immediately instead having to wait for it.
Updates will be processed as long as there is at least one handler added, and adding the first handler will trigger a forced synchronization of the update state (manually called through `client.sync_updates()`).
**You cannot invoke requests from within these handlers**. The handlers are called from a **read-only thread**, and attempting to invoke a request (hence sending it) will raise an `AssertionError`.
**You cannot invoke requests from within these handlers**. They will all `return None`. The handlers are called from a **read-only thread**, and attempting to invoke a request (hence sending it) will have no effect.
## Reacting to updates