Skip to content

Supporting daemon type actions#63

Open
gliechtenstein wants to merge 1 commit intodevelopfrom
daemon_actions
Open

Supporting daemon type actions#63
gliechtenstein wants to merge 1 commit intodevelopfrom
daemon_actions

Conversation

@gliechtenstein
Copy link
Contributor

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:

  1. call inline

    {
    “type”: “$render”
    }

  2. 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
module variable for every action call, so it’s impossible to refer to
them 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:

1. call inline

    {
      “type”: “$render”
    }

2. 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
`module` variable for every action call, so it’s impossible to refer to
them later)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant