[aerogear-dev] [AeroGear-Notifier] Client API
Matthias Wessendorf
matzew at apache.org
Tue Feb 26 09:39:46 EST 2013
On Tue, Feb 26, 2013 at 3:11 PM, Kris Borchers <kris at redhat.com> wrote:
> I don't see them as different subscribes, just different sets of arguments
> passed to callback. Maybe this will help illustrate.
>
> If you look at
> https://github.com/kborchers/aerogear-js/blob/Notifier/src/notifier/adapters/vertx.js#L201,
> you'll see that the callback is just passed directly to the underlying
> library with no concern for what arguments are used. This will eventually be
> moved to a subscribe() method but I just did it in connect right now.
> Anyway, this means the API for any adapter would be the same and the
> difference in arguments would just need to be documented. Does that make
> sense? Is that any better?
Thinking about the replyTo..... Do we really need it ? It simply
sends back a reply to the (given) addrees:
https://github.com/matzew/vertx-push-demo/blob/master/www/js/vertxbus.js#L120
This could be left up to the end-users (e.g. if they want to reply,
the need to write their own code, that sends a message to a given
channel (as a reply to receiving a message).
Stomp does NOT do/offer this... but... we could implement it for them
as well....
So... we could have the same args for both:
a) subscribe("channel, function(msg));
b) subscribe("channel, function(msg, replyTo));
Hrm...
>
> On Feb 26, 2013, at 7:56 AM, Matthias Wessendorf <matzew at apache.org> wrote:
>
> we have no control over what the underlying library passes to the callback.
> I guess we could write some intermediary process that intercepts the
> callback and reformats it to just provide a message but I
> feel like that would limit people that want access to those other parameters
> that the library for which we provide an "adapter" is providing.
>
>
> I think the real problem is this, having different impls:
> vert.x -> subscribe("channel", function(msg, replyTo));
> stomp.js -> subscribe("channel", function(msg));
>
> but how to 'hide' behind a unified API ?
>
>
> a) ignoring 'un common' args (e.g. the replyTo, on vertx)
> b) having different subscribes -> ugly API
>
> Or am I not seeing something, obvious, specific to JS ?
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
>
>
>
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
--
Matthias Wessendorf
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
More information about the aerogear-dev
mailing list