@@ -46,7 +46,7 @@ async def what_you_want_to_do(clock, label):
4646 await atk.event(label, ' <Button>' )
4747 print (' C' )
4848
49- nursery .start(what_you_want_to_do(... ))
49+ atk .start(what_you_want_to_do(... ))
5050```
5151
5252## Installation
@@ -118,8 +118,8 @@ if __name__ == "__main__":
118118
119119### threading
120120
121- Unlike ` Trio ` and ` asyncio ` , ` asynctkinter ` doesn't provide any I/O functionalities,
122- thus threads may be the best way to perform them without blocking the main thread:
121+ Unlike ` trio ` and ` asyncio ` , ` asynckivy ` does not provide any I/O primitives.
122+ Therefore, if you don’t want to implement your own, using threads may be the best way to perform I/O without blocking the main thread.
123123
124124``` python
125125from concurrent.futures import ThreadPoolExecuter
@@ -130,16 +130,16 @@ executer = ThreadPoolExecuter()
130130async def async_fn (clock : atk.Clock):
131131 # create a new thread, run a function inside it, then
132132 # wait for the completion of that thread
133- r = await clock .run_in_thread(thread_blocking_operation, polling_interval = 1.0 )
133+ r = await atk .run_in_thread(clock, thread_blocking_operation )
134134 print (" return value:" , r)
135135
136136 # run a function inside a ThreadPoolExecuter, and wait for its completion.
137137 # (ProcessPoolExecuter is not supported)
138- r = await clock .run_in_executer(executer, thread_blocking_operation, polling_interval = 0.1 )
138+ r = await atk .run_in_executer(clock, executer, thread_blocking_operation )
139139 print (" return value:" , r)
140140```
141141
142- Exceptions( not BaseExceptions ) are propagated to the caller,
142+ Unhandled exceptions (excluding ` BaseException ` that is not ` Exception ` ) are propagated to the caller
143143so you can catch them like you do in synchronous code:
144144
145145``` python
@@ -148,7 +148,7 @@ import asynctkinter as atk
148148
149149async def async_fn (clock : atk.Clock):
150150 try :
151- r = await clock .run_in_thread(lambda : requests.get(' htt...' , timeout = 10 ), ... )
151+ r = await atk .run_in_thread(clock, lambda : requests.get(' htt...' , timeout = 10 ), ... )
152152 except requests.Timeout:
153153 print (" TIMEOUT!" )
154154 else :
0 commit comments