io
Classes
TaskIO
Bases: ABC
Abstract Task I/O interface.
Responsible for reading, writing, and removing task state data to persistent storage.
Attributes
Functions
exists
abstractmethod
Checks if a state data file exists in persistent storage
from_base_url
staticmethod
from_base_url(
base_url: str, encoding: str = "utf-8", **kwargs
) -> TaskIO
list
abstractmethod
Lists objects in the persistent storage that match the specified prefix, typically this will be the task ID
TaskIOFile
Bases: TaskIO
Task I/O implementation for file-based storage
Attributes
Functions
build_url
Builds a URL for a given object name by appending it to the base URL.
Parameters:
-
obj_name
(str
) –The object name to convert.
Returns:
-
str
(str
) –The corresponding filesystem path.
exists
Checks if a state data file exists.
Parameters:
-
obj_name
(str
) –The object name to be appended to the base URL.
Returns:
-
bool
(bool
) –True if the file exists, False otherwise.
list
Lists objects in the persistent storage that match the specified prefix, typically this will be the task ID
read
Reads state data from a file.
Parameters:
-
obj_name
(str
) –The object name to be appended to the base URL.
Returns:
-
str
(str
) –The data read from the file.
remove
Removes a state data file.
Parameters:
-
obj_name
(str
) –The object name to be appended to the base URL.