-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Implementing functional composition for stores would be pretty cool.
The idea is a simple as creating a store that can be initialized with references to other stores, and implementing the core operations in such a way that the apply to constituent stores in different ways.
For example, a Mnemonix.Meta.MigrationStore might be initialized with a new and old store, and:
def fetch({old, new}, key) do
if key in old do
value = fetch old, key
put new, key, value
delete old, key
value
else
fetch new, key
end
endAdditional candidates for initial implementation would be a ReplicaStore that reads from one and writes to many, with some sort of way to fail over on crash, or a PoolStore that reads from first available one and writes to many. All of these would have some hard decisions to make on handling the features sets like expiration, transactions, and supervision.
Reactions are currently unavailable