DurableStateStorePostgreSQL
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Clears/resets the internal data structures used by the storage backend if not already created.
Clears/resets the internal data structures used by the storage backend if not already created.
Attributes
- Returns
-
an
IO[Unit]
- Definition Classes
Create and initialize the internal data structures used by the storage backend if not already created.
Create and initialize the internal data structures used by the storage backend if not already created.
Note: It is guaranteed that this operation will not truncate/clear the underlying storage, but just create it in case it does not already exist. If you need to clear the storage, use method clear instead.
Attributes
- Returns
-
an
IO[Unit]
- Definition Classes
Drops the internal data structures used by the storage backend.
Drops the internal data structures used by the storage backend.
Attributes
- Returns
-
an
IO[Unit]
- Definition Classes
Reads the current encoded (serialized) state for a given persistenceId
from the storage backend.
Reads the current encoded (serialized) state for a given persistenceId
from the storage backend.
Value parameters
- persistenceId
-
The PersistenceId of the encoded state instance to read
Attributes
- Returns
-
Some if the entry exists in the storage backend, else None
- Definition Classes
Writes (creates or replaces) an encoded (serialized) state for a given persistenceId
into the storage backend.
Writes (creates or replaces) an encoded (serialized) state for a given persistenceId
into the storage backend.
The method will fail if the revision of new encoded state is not exactly the successor of the revision of the current encoded state, i.e., newRevision == currentRevision + 1
. This ensures that there is no collision with persistence IDs that have accidentally been used multiple times.
Implementation note: The revision check could have easily been put into the generic write method. This would have eliminated the need to do the logic in each implementation of writeEncodedState, but it would also have eliminated the possibility to do the logic more efficient. This is why the decision was made to do it here for each implementation.
Value parameters
- encodedState
-
The state instance of type EncodedState
- persistenceId
-
The PersistenceId of the encoded state instance to write
Attributes
- Returns
-
IO[Unit]
- Definition Classes
Inherited methods
Reads the current revision of the DurableState for type A
from storage backend.
Reads the current revision of the DurableState for type A
from storage backend.
Value parameters
- payloadCodec
-
a given PayloadCodec to convert instances of type
A
to a byte array and vice versa - persistenceId
-
The PersistenceId of the durable state instance to read
Attributes
- Returns
-
Some if the entry exists in the storage backend, else None
- Inherited from:
- DurableStateStore
Writes a new revision of the DurableState for type A
from storage backend.
Writes a new revision of the DurableState for type A
from storage backend.
The method will fail if the revision of new encoded state is not exactly the successor of the revision of the current encoded state, i.e., newRevision == currentRevision + 1
. This ensures that there is no collision with persistence IDs that have accidentally been used multiple times.
Value parameters
- payloadCodec
-
a given PayloadCodec to convert instances of type
A
to a byte array and vice versa - persistenceId
-
The PersistenceId of the durable state instance to write
- state
-
The DurableState of type
A
Attributes
- Returns
-
An
IO[Unit]
- Inherited from:
- DurableStateStore