-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use tensorstore async for writing out parameter group files #61
Comments
Mixing async and normal code can be tricky. Here is the skeleton of a common way to do it (sorry if I over-explain).
async write_tracked_file(...):
"""This is the update to make the tensorstore write async."""
async write_all_tracked_files(...):
"""This is what schedules the async tasks to be done concurrently."""
await aysncio.gather(
write_tracked_file(x) for x in ...
)
# From your real code. This is executing it in a blocking way in the main synchronous code
asyncio.run(write_all_tacked_files(...)) If we want to have a minimum python version of 3.7 we can just use this def async_run(to_run):
loop = asyncio.get_event_loop()
return loop.run_until_complete(write_all_tracked_files) Let me know if anything is unclear |
The new update class modules changes how this will need to be implemented, we probably need to have |
This was done in #121 |
No description provided.
The text was updated successfully, but these errors were encountered: