Distributed Hash Table¶
Local Hash Table¶
First, read about state actors.
The 1:1 API implementation between actors and their inner table is achieved by
internally blocking on an
ask from riker patterns.
The actor ref methods implementing
HashTable sends messages to itself.
table_actor_ref.commit(entry) looks like this:
- the actor ref constructs a
Protocol::PutPairmessage including the entry
- the actor ref calls its own
askmethod, which builds a future using riker's
- the actor ref blocks on its internal future
- the referenced actor receives the
Commitmessage and matches/destructures this into the entry
- the entry is passed to the
commit()method of the inner table
- the actor's inner table, implementing
HashTable, does something with commit (e.g. MemTable inserts into a standard Rust, in-memory
- the return value of the inner table
commitis inserted into a
CommitResultmessage is sent by the actor back to the actor ref's internal future
- the actor ref stops blocking
CommitResultmessage is destructured by the actor ref so that the return of
ask returns a future from the futures
unwrap against this ask.
Both the block and the unwrap should be handled better in the future.