Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This stack of changes gives us a
terminate(petName)
method on the Endo Host Powers object. This will cause the daemon to forget the current incarnation of that named value and all named values that depend upon it, including parties that received the value throughrequest
oradopt
. This also terminates workers.The implications of termination are far-reaching and this is only the beginning. New formulas may self-destruct, like a formula that uses a file watcher to invalidate itself when its on-disk dependencies change. Connections may self-destruct if they disconnect. Weblets might auto-reload if their powers are invalidated.
Also, because the formulas form an acyclic DAG, simple ref-counting should suffice for garbage collecting formulas. Formulas can be retained by pet name paths, but also live values, so using a WeakRef in the future should allow us to automatically terminate and collect provably unreachable formulas.
To make this work, the internal memo now envelopes values in a controller object to track the corresponding terminator (synchronously) and the internal and external facets of the formula. This cleans up some side tables previously held for formula-specific internals like the worker bootstrap and the message bus between parties.