mozilla / mentat

UNMAINTAINED A persistent, relational store inspired by Datomic and DataScript.
https://mozilla.github.io/mentat/
Apache License 2.0
1.65k stars 115 forks source link

Transaction Log Observation #551

Closed fluffyemily closed 6 years ago

fluffyemily commented 6 years ago

Transaction observation

Things I could still do:

Things I tried for storing observers:

rnewman commented 6 years ago

TxObserverService called when InProgress commits and filters TxObservers that are affected by the tx's that occurred and notifies them of what changed

So if I do this:

it sounds like my observer will be notified of a write that occurred prior to registering, no? Is that what we want? I'm not sure what the user expectation would be.

fluffyemily commented 6 years ago

But surely, until that write commits, it's sorta not done?

Originally I batched up transacts inside the observer, logging them against each matching observer as they occur and then only sending the batches on commit. It would be easy enough to revert back to that strategy and would solve this problem.

fluffyemily commented 6 years ago

Or keep the map of observers->transacts inside InProgress by making observers_for_attributes a public function. Either way it would work.

rnewman commented 6 years ago

Or keep the map of observers->transacts inside InProgress by making observers_for_attributes a public function. Either way it would work.

IMO:

fluffyemily commented 6 years ago

followup https://github.com/mozilla-prototypes/sync-storage-prototype/issues/55