Muscat.Helpers.Future module¶
- class Future(task, *args)[source]¶
Bases:
objectRun a task asynchronously in a background thread.
Instead of calling a method directly:
res = method(arg1, arg2)
create a future and retrieve the result later:
future = Future(method, arg1, arg2) # ... res = future.get()
Notes
This is mostly useful for tasks that release the GIL; pure Python work may still execute sequentially.
- args_: tuple[Any]¶
- originalArgs_: list[Any]¶
- res_: Any¶
- wasWritable_: list[bool]¶