Supporting daemon type actions #63
Open
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.
Until now, actions have been something that’s just a one off thing that
does its job and goes away.
Now we are trying to support a new type of action that can stick around
as a daemon and sends events to Jason core so it can kick off a new
action call chain whenever the event occurs. (Like $load, $show,
$foreground, but for action).
To support this we need a new NSNotification endpoint for Jason core:
call, which kicks off any action call chain such as:call inline
{
“type”: “$render”
}
call by name
{
“trigger”: “refresh_view”
}
Also we need to tie these Action instances to the parent view
controller so they don’t get garbage collected after execution—that’s
how they stick around to send notifications later. (Actually it’s not
even garbage collection, the previous approach actually reuses the same
modulevariable for every action call, so it’s impossible to refer tothem later)