Comments (1)
Copying over my review comments about this:
The reason I added the watcher was to abstract away this growing set of "when this happens inside
transact
, do this" behaviors. Imagine that we want to add an observer that fires if a particular value is seen, a particular entity is touched, or any datom is retracted.You can easily imagine the observer API you've built being expressed as a watcher that collects notes about
tx_id
s, later (when the tx is committed) using those notes to dispatch particularTxReport
s to particular observers. Indeed, you can use an arbitrary datom-level predicate to decide whether a report is of interest.The watcher approach means we don't do any work unless there are caches/observers, and we don't allocate memory unless the watcher needs to.
Using TransactWatcher
scopes the problem down to:
- What changes do I need to make to
TransactWatcher
to support observer workloads? It probably needs to be told thetx_id
. - How do I make a
TransactWatcher
from the observer service to hand off to anInProgress
? - How do I get the value back out when it's
done
? - How do I combine the cache watcher and the observer watcher? Big chunks of the transactor are generic over
W
, so we should try to avoid making too many watcher types that are used in the same codebase — monomorphization will balloon our binary size. To me that points tostruct DefaultTransactWatcher(cache_watcher: Option<InProgressCacheTransactWatcher>, observer_watcher: Option<ObserverWatcher>)
…
The end result should be that the transactor doesn't know anything at all about observers, and doesn't track anything that the observer service needs, just as it doesn't track anything for the attribute cache — the watcher does all that.
from toodle.
Related Issues (20)
- [demo][stretch goal] Add UI for label creation to iOS HOT 1
- Update toodle to use var macro
- Expose basic "sync now" via functionality over FFI
- Add timer to CLI HOT 1
- Add cache command to cli
- Android Toodle crashes on new_toodle (Rust panic) call after recent changes HOT 2
- Create cross platform logging crate
- Add FFI for generic API
- Swift Library
- Android Library
- JS Interface
- Cross compilation tooling
- Swift compatible C Header generation
- Android footprint size.
- Cross platform logging crate
- Debugging!
- Enable Rust library to be built with Bitcode enabled on iOS
- C++ XPCom library
- Documentation!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toodle.