Skip to content

Commit

Permalink
use asyncio.gather in _set_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
d-v-b committed Aug 3, 2024
1 parent da6083e commit e4101b7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zarr/abc/store.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from abc import ABC, abstractmethod
from asyncio import gather
from collections.abc import AsyncGenerator, Mapping
from typing import Any, NamedTuple, Protocol, runtime_checkable

Expand Down Expand Up @@ -225,8 +226,7 @@ async def _set_dict(self, dict: Mapping[str, Buffer]) -> None:
"""
Insert objects into storage as defined by a prefix: value mapping.
"""
for key, value in dict.items():
await self.set(key, value)
await gather(*(self.set(key, value) for key, value in dict.items()))
return None


Expand Down

0 comments on commit e4101b7

Please sign in to comment.