-
-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Description
As mentioned in #3748, our IO operations look like this:
def get(key) -> payload | None: ...
def set(key) -> None: ...
There's a similar story for the CodecPipeline class which has its own, slightly different IO API.
Practically this means we are throwing away a lot of useful information about each IO operation, such as how long these operations took, as well as store-specific metadata like http status codes.
Here is a proposed minimal API:
class GetResult(TypedDict):
key: str
duration: float
status: Literal["success", "missing"]
payload: NotRequired[bytes]
class SetResult(TypedDict):
"""TBD"""
key: str
duration: float
def get(key) -> GetResult: ...
def set(key) -> SetResult: ...
Our stores are all capable of giving us this information. We should probably use it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels