Skip to content

Commit 07b7649

Browse files
committed
Add a comment for a future improvement idea.
1 parent 6ef32d2 commit 07b7649

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pyhilo/util/state.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,9 @@ async def set_state(
114114
new_state: dict[str, Any] = {**current_state, **merged_state}
115115
async with aiofiles.open(state_yaml, mode="w") as yaml_file:
116116
LOG.debug("Saving state to yaml file")
117+
# TODO: Use asyncio.get_running_loop() and run_in_executor to write
118+
# to the file in a non blocking manner. Currently, the file writes
119+
# are properly async but the yaml dump is done synchroniously on the
120+
# main event loop.
117121
content = yaml.dump(new_state)
118122
await yaml_file.write(content)

0 commit comments

Comments
 (0)