Skip to content

Storage

dotflow.abc.storage.Storage

Bases: ABC

Storage

Source code in dotflow/abc/storage.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class Storage(ABC):
    """Storage"""

    def __init__(self, *args, **kwargs):
        pass

    @abstractmethod
    def post(self, key: str, context: Context) -> None:
        """Post context somewhere"""

    @abstractmethod
    def get(self, key: str) -> Context:
        """Get context somewhere"""

    @abstractmethod
    def key(self, task: Callable):
        """Function that returns a key to get and post storage"""

    @abstractmethod
    def clear(self, workflow_id: str) -> None:
        """Remove every persisted entry under ``workflow_id``.

        Used by the input-fingerprint reset path when
        ``on_input_change='reset'``.
        """

__init__(*args, **kwargs)

Source code in dotflow/abc/storage.py
12
13
def __init__(self, *args, **kwargs):
    pass

clear(workflow_id) abstractmethod

Remove every persisted entry under workflow_id.

Used by the input-fingerprint reset path when on_input_change='reset'.

Source code in dotflow/abc/storage.py
27
28
29
30
31
32
33
@abstractmethod
def clear(self, workflow_id: str) -> None:
    """Remove every persisted entry under ``workflow_id``.

    Used by the input-fingerprint reset path when
    ``on_input_change='reset'``.
    """

get(key) abstractmethod

Get context somewhere

Source code in dotflow/abc/storage.py
19
20
21
@abstractmethod
def get(self, key: str) -> Context:
    """Get context somewhere"""

key(task) abstractmethod

Function that returns a key to get and post storage

Source code in dotflow/abc/storage.py
23
24
25
@abstractmethod
def key(self, task: Callable):
    """Function that returns a key to get and post storage"""

post(key, context) abstractmethod

Post context somewhere

Source code in dotflow/abc/storage.py
15
16
17
@abstractmethod
def post(self, key: str, context: Context) -> None:
    """Post context somewhere"""