{"action":"created","issue":{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/368","labels_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/368/comments","events_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/368/events","html_url":"https://github.com/ozone-development/ozp-iwc/issues/368","id":121102311,"number":368,"title":"Intent invocation resolve changes","user":{"login":"Kevin-K","id":7290455,"avatar_url":"https://avatars.githubusercontent.com/u/7290455?v=3","gravatar_id":"","url":"https://api.github.com/users/Kevin-K","html_url":"https://github.com/Kevin-K","followers_url":"https://api.github.com/users/Kevin-K/followers","following_url":"https://api.github.com/users/Kevin-K/following{/other_user}","gists_url":"https://api.github.com/users/Kevin-K/gists{/gist_id}","starred_url":"https://api.github.com/users/Kevin-K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kevin-K/subscriptions","organizations_url":"https://api.github.com/users/Kevin-K/orgs","repos_url":"https://api.github.com/users/Kevin-K/repos","events_url":"https://api.github.com/users/Kevin-K/events{/privacy}","received_events_url":"https://api.github.com/users/Kevin-K/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/labels/API:%20intents.api","name":"API: intents.api","color":"009800"},{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/labels/Client","name":"Client","color":"fbca04"},{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/labels/Severity:%20Minor","name":"Severity: Minor","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-08T21:24:40Z","updated_at":"2015-12-11T17:12:02Z","closed_at":null,"body":"Currently the Intent Invocation resolves when the IWC internal's acknowledge the invoke request.\r\n\r\nA more intuitive use would be have the invoke behave like a `get` action. Whereas, the invoke promise resolves **when the intent handler finishes handling the intent**. Optionally if the handler returns a value it will be passed to the intent invokee.\r\n\r\nThis means functionality for intents is not limited to just \"call someone elses function for modification of their app\", this now means an intent handler can be used as soley a remote function. An application can be used to compute some request and return the result to the invoker:\r\n```\r\nintents.invoke(\"/json/data/size\",{ entity: { /* some json object to get the byte size of (made up intent) */}).then(function(resp){\r\n   console.log(\"Remotely computed size was: \" resp.entity);\r\n});\r\n```\r\n\r\n*** \r\n\r\nVery minor modification, client code needs to ignore the replyTo of the intents.api internals sending an \"ok\" for the invoke, the response currently gets ignored because the \"ok\" goes to the resolution of the promise:\r\n\r\nhttps://github.com/ozone-development/ozp-iwc/blob/master/src/js/common/apiPromiseMixin.js#L671"},"comment":{"url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/comments/163993584","html_url":"https://github.com/ozone-development/ozp-iwc/issues/368#issuecomment-163993584","issue_url":"https://api.github.com/repos/ozone-development/ozp-iwc/issues/368","id":163993584,"user":{"login":"Kevin-K","id":7290455,"avatar_url":"https://avatars.githubusercontent.com/u/7290455?v=3","gravatar_id":"","url":"https://api.github.com/users/Kevin-K","html_url":"https://github.com/Kevin-K","followers_url":"https://api.github.com/users/Kevin-K/followers","following_url":"https://api.github.com/users/Kevin-K/following{/other_user}","gists_url":"https://api.github.com/users/Kevin-K/gists{/gist_id}","starred_url":"https://api.github.com/users/Kevin-K/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kevin-K/subscriptions","organizations_url":"https://api.github.com/users/Kevin-K/orgs","repos_url":"https://api.github.com/users/Kevin-K/repos","events_url":"https://api.github.com/users/Kevin-K/events{/privacy}","received_events_url":"https://api.github.com/users/Kevin-K/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T17:12:02Z","updated_at":"2015-12-11T17:12:02Z","body":"Gitbook updated, broadcast functionality implemented.\r\n\r\nUpdating tutorials, will close this issue once tutorials are finished."}}