Anoma.Client.Storage (Anoma v0.31.0)
I am the Client Storage module.
I represent the local timestamped cache of a client akin to the Node Storage.
In contrast to the Node Storage I
- never block and return an error on evident semantics failures
- use os time for timestamps
- don't have in-progress storage and commit directly to default tables
Public API
I have the following public functionality:
- read/1
- write/2
Summary
Functions
I am the Client Storage read function.
I am the Client Storage function for reading with IDs.
I am the Client Storage write function.
Functions
read(arg)
@spec read({non_neg_integer(), any()}) :: {:ok, any()} | :absent | :error
I am the Client Storage read function.
If the time is in the future in comparisson to OS time, I error. If we read before any value was writte, I error.
Otherwise I read the closest value in the past.
read_with_id(arg)
I am the Client Storage function for reading with IDs.
Given an existing id in the stored table, I read the key at the associated timestamp. Otherwise, I read at current time and store said time as value to the provided id.
write(arg)
I am the Client Storage write function.
I allow to write only at the current OS time.