Class: Hibiki::Root
Overview
---- root ------------------------------------------------------------------- Solid's createRoot: an ownership scope that is not an effect. Effects and cleanups created inside the block belong to the root and live until #dispose — the lifecycle anchor for long-lived graphs (a session, a connection) whose teardown is an external event, not a rerun.
Deliberately detached: a root created inside a running effect is NOT adopted, so the enclosing effect's rerun/disposal leaves it alone (Solid's escape hatch from the owner tree). Whoever holds the root disposes it.
The block runs untracked (Solid clears the Listener in createRoot): a root built mid-effect must not subscribe that effect to signals it reads.
Instance Method Summary collapse
- #dispose ⇒ Object
- #disposed? ⇒ Boolean
-
#initialize(&block) ⇒ Root
constructor
A new instance of Root.
Methods included from Owner
Constructor Details
Instance Method Details
#dispose ⇒ Object
30 31 32 33 34 35 |
# File 'lib/hibiki/root.rb', line 30 def dispose return if @disposed @disposed = true dispose_owned end |
#disposed? ⇒ Boolean
28 |
# File 'lib/hibiki/root.rb', line 28 def disposed? = @disposed |