[ 
https://issues.apache.org/jira/browse/SHINDIG-1612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13094955#comment-13094955
 ] 

[email protected] commented on SHINDIG-1612:
--------------------------------------------------------



bq.  On 2011-08-31 21:43:06, Ryan Baxter wrote:
bq.  > 
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js,
 line 789
bq.  > <https://reviews.apache.org/r/1689/diff/2/?file=37008#file37008line789>
bq.  >
bq.  >     Any particular reason why you chose to do the removeListener this 
way?  I would expect the API to take in the listener you want to remove, not a 
token....
bq.  >     One disadvantage I could think of is you have to save off this token 
somewhere to use it later on if you want to remove it.  Then again you also 
need to save off your listener if you want to remove it as well, so maybe there 
really is no difference.  Also as far as consistency, are there other listener 
APIs in the container today?  How do they do it?

The examples of registering handlers in actions are all singletons.  So is the 
container's addGadgetLifecycleCallback.

I was looking for something a little more flexible for the actions listeners.   
Allowing the container to register different functions to handle different 
action invocations (or the same action invocation).

I also did not want to have 1 single function callback for all actions, as 
actions can happen many times... and there is a cost to executing a function.  
Checking a boolean expression first to see if we should even call the callback 
based on the id saves us that unneeded function call.

If there's significant pressure from the community on conforming to the 
existing model I'll follow suit, but I think actions are a specific, dynamic, 
and frequent enough occurrence to justify a more flexible impl.


- Dan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1689/#review1705
-----------------------------------------------------------


On 2011-08-31 20:07:34, Dan Dumont wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/1689/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-08-31 20:07:34)
bq.  
bq.  
bq.  Review request for shindig, Ryan Baxter and Stanton Sievers.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  Specification: 
http://code.google.com/p/opensocial-resources/issues/detail?id=1210
bq.  
bq.  Add 2 functions to the actions feature.
bq.  1 to allow the container to register a listener for an action being run.  
The listener would be run whenever an action matching the id provided was run.
bq.  1 to allow the container to unregister(remove) any listener added with the 
previous function.
bq.  
bq.  
bq.  This addresses bug SHINDIG-1612.
bq.      https://issues.apache.org/jira/browse/SHINDIG-1612
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    
http://svn.apache.org/repos/asf/shindig/trunk/features/src/main/javascript/features/actions/actions_container.js
 1163664 
bq.  
bq.  Diff: https://reviews.apache.org/r/1689/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  If anyone has any suggestions as to how to approach adding unit tests for 
this, I'm all ears.
bq.  
bq.  It looks like that in order to get the actions api to hit this code, by 
calling runAction, I'd need to somehow fake setting up a gadget site and 
register a fake action.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Dan
bq.  
bq.



> Implement Specification: Issue 1210: Extend actions feature to allow 
> container to register listeners for when actions are run
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SHINDIG-1612
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1612
>             Project: Shindig
>          Issue Type: Improvement
>          Components: Javascript 
>            Reporter: Dan Dumont
>            Priority: Minor
>         Attachments: upstream.patch
>
>
> Specification: 
> http://code.google.com/p/opensocial-resources/issues/detail?id=1210
> Add 2 functions to the actions feature.
> 1 to allow the container to register a listener for an action being run.  The 
> listener would be run whenever an action matching the id provided was run.
> 1 to allow the container to unregister(remove) any listener added with the 
> previous function.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to