Hacker News new | ask | show | jobs
by xapata 3434 days ago

    foo.on_click(partial(q.append, foo))
The nice thing about ``append`` is it's atomic (for builtins).
1 comments

Where does the update of `x` go in this example? By observing a Queue or Stream `q`?
If it must be mutable state, then ideally you'd have a single consumer thread for counting off that queue to avoid worrying about locks.

Or maybe what's in the queue gets written to a permanent log and ``x`` is a query of that log, a la Datomic.