This commit is contained in:
MikeTheWatchGuy 2019-09-09 18:39:36 -04:00
parent a9463a1f14
commit 57dba7a2f7
1 changed files with 2 additions and 2 deletions

View File

@ -209,9 +209,9 @@ This unpacks the 2 values in to 2 variables `event` representing the event that
#### `Window.read()` is Like `Queue.get()` #### `Window.read()` is Like `Queue.get()`
\* Recall earlier in the Queue example I said the `Queue.get` model would be seen again. You just saw it in the `window.read()` call. The default action is to block on that read. Just like `Queue.get()` you can put a timeout value on the call and make it a non-blocking call. \* Recall earlier in the Queue example I said the `Queue.get` model would be seen again. You just saw it in the `window.read()` call. The default action is to block on that read. Just like `Queue.get()` you can put a timeout value on the call so that the block will end after the timeout and return back to you.
Here is how you can get a window's events in a non-blocking way. In this example, the `timeout` or 100 means "wait for up to 100 ms" for an event to take place. Here is how you can get a window's events in the same block with a timeout way. In this example, the `timeout` of 100 means "block for up to 100 ms" for an event to take place, then return.
```python ```python
event, values = window.read(timeout=100) event, values = window.read(timeout=100)