Insist to run short operations on the ReadThread

Lonami 2017-09-19 13:04:18 +02:00
parent ab411f94ab
commit 44b726c338

@ -17,9 +17,9 @@ client.remove_update_handler(my_handler)
# handlers = client.list_update_handlers() # handlers = client.list_update_handlers()
``` ```
An update handler is nothing else than a method accepting a single parameter, the update object to be processed. 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.
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()`) 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**. The handlers are called from a **read-only thread**, and attempting to invoke a request (hence sending it) will raise an `AssertionError`.