You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Paul Lindner (JIRA)" <ji...@apache.org> on 2008/07/10 21:10:31 UTC

[jira] Commented: (SHINDIG-441) Asynchronous rpc handler support

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

Paul Lindner commented on SHINDIG-441:
--------------------------------------

I like!  This will simplify a lot of code where we have to create RPC code for forward and reverse calls.

Thanks!


> Asynchronous rpc handler support
> --------------------------------
>
>                 Key: SHINDIG-441
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-441
>             Project: Shindig
>          Issue Type: New Feature
>          Components: Features (Javascript)
>            Reporter: Zhen Wang
>
> Currently an gadget rpc handler must be synchronous. Its return value is immediately passed back to the rpc caller if a callback function is defined. This prevents an rpc request handler to make some asynchronous calls and return a value later.
> Proposed solution:
> Add a callback method to the rpc context object for an rpc request handler to return a value asynchronously.
> This won't affect existing code. Synchronous handlers may simply ignore the change and return a value as usual while async handlers don't return a value immediately and call "this.callback(return_value);" when ready.
> Patch to rpc.js:
> 232,236d231
> <       if (rpc.c) {
> <         rpc.callback = function(result) {
> <           gadgets.rpc.call(rpc.f, CALLBACK_NAME, null, rpc.c, result);
> <         };
> <       }
> 242c237
> <       if (rpc.c && typeof result != 'undefined') {
> ---
> >       if (rpc.c) {

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.