On Thu, May 7, 2009 at 2:13 PM, Jordan Zimmerman <[email protected]> wrote:

> >https://issues.apache.org/jira/browse/SHINDIG-1049
>
> I've run into a problem with this and would like some suggestions. The
> callback argument throws a wrench into things. The RPC mechanism doesn't
> allow support of the callback. I can see three possible solutions:
>
> * Return NOT_IMPLEMENTED if a callback is passed
>
> * Discover a way to do reverse RPC (is this possible)?


Both gadget to container and container to gadget communications are possible
in an async channel, but you don't really need that. The parent page can
(and should) respond asynchronously to RPC calls:

opensocial.requestSendMessage = function(..iforgettheargnames..., callback)
{
  gadgets.rpc.call("..", "requestSendMessage", callback,
otherargumentsgohere);
}

container page:

gadgets.rpc.register("requestSendMessage", function(message) {
  showSomeUiComponentToConfirmMessageWithCallback(message, this.callback);
});

The container page must call rpc.callback to send the reply message back,
but this certainly works. See the 'process' function in gadgets.rpc for
details.


> * Don't use RPC for requestSendMessage(). Instead add a method to
> AppDataService such as:
>          Future<Void> sendMessage(Set<UserId> userIds, String appId,
>                Set<String> fields, SecurityToken token)
>                        throws ProtocolException;
>
> Thoughts?
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> [email protected]
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this
> message
> immediately if this is an electronic communication.
>
> Thank you.
>

Reply via email to