bridge
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| SessionBridge datacook.app.bridge |
🛈 DocStrings¶
SessionBridge: engine events (any thread) -> coalesced Qt signals on the GUI thread.
session.subscribe(bridge.on_event) once. on_event and post may be called from any
thread: they append to one locked FIFO (eventqueue.EventQueue) and, if no drain is
scheduled, emit the private _wake signal, connected with a queued connection to _drain
on the bridge's (GUI) thread. _drain coalesces (eventqueue.coalesce) and emits the typed
signals below; posted calls run in queue order between them, so a request done callback
comes after the MATERIALIZED event of the same computation.
Signals carry tuples of node ids. Ids in nodes_removed may be unknown to a view (a node
added and removed within one drain): ignore those.
SessionBridge
¶
Bases: QObject
Source code in src/datacook/app/bridge.py
drained
class-attribute
instance-attribute
¶
After each drain (tests, coarse refreshes).
memory_changed
class-attribute
instance-attribute
¶
Once per drain after anything that changes session.memory().
node_error
class-attribute
instance-attribute
¶
(failing node id, exception).
nodes_changed
class-attribute
instance-attribute
¶
Params / name / comment changed.
nodes_invalidated
class-attribute
instance-attribute
¶
Cached results outdated (edited node + descendants); a new generation each.
nodes_moved
class-attribute
instance-attribute
¶
Nodes got new parents (a middle step was deleted / restored); INVALIDATED follows.
nodes_removed
class-attribute
instance-attribute
¶
The removed nodes incl. descendants.
structure_reset
class-attribute
instance-attribute
¶
Too many events at once (project load): rebuild views from the session.
flush
¶
on_event
¶
post
¶
Run fn(*args) on the GUI thread, after everything queued before (any thread).