<meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div><br></div><div>This may have been discussed earlier. What is the targeted benefit other than the unified client?&nbsp;</div><div><br></div><div>Do we see that a single app is using more than one of these backends? Or is there a target to provide a messaging channel through controller perhaps?&nbsp;</div><div><br></div><div>Just curious.</div><div><br></div><div>--</div><div>Gorkem</div><div><br></div><br><div><div>On Feb 21, 2013, at 7:38 PM, Matthias Wessendorf [via aerogear-dev] &lt;<a href="/user/SendEmail.jtp?type=node&node=1815&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite"><p style="margin-right:0px;margin-bottom:15px;margin-left:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px;margin-top:0px!important">Hello!</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">
Today, I had a brief chat with Kris about a potential AeroGear&nbsp;<em>Notifier</em>&nbsp;Client API...</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">
The basic idea is to&nbsp;<em>wrap</em>&nbsp;messaging APIs (e.g. Stomp.js, Vertx's eventbus or Socket.io/Engine.io) behind a common client 'interface'.</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">
Basically the AeroGear-Notifier should be able to&nbsp;<em>connect</em>&nbsp;to a messaging system in order to&nbsp;<em>subscribe</em>&nbsp;to a channel to reveice messages from that channel. The AG-Notifier is also able to&nbsp;<em>publish</em>&nbsp;messages to ANY channel. Of course,<em>unsubscribe</em>&nbsp;and&nbsp;<em>disconnect</em>&nbsp;are required too...</p><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">Sure... the above is not (YET) really a&nbsp;<em>SPEC</em>, but it's start.... the JS API of the AG-Notifier (DRAFT 0.0.1) could looks like this:</p>
<div class="highlight" style="background-color:rgb(255,255,255);border:0px;padding:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px"><pre style="font-size:13px;line-height:19px;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><span class="cm" style="color:rgb(153,153,136);font-style:italic">/**</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * Connects to a given URL. The callback is invoked after a connection has been established. In case of an error, an Error</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * object will be passed to the callback</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> */</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">connect</span><span class="p">(</span><span class="nb" style="color:rgb(0,134,179)">String</span> <span class="nx">url</span><span class="p">,</span> <span class="kd" style="font-weight:bold">function</span> <span class="nx">callback</span><span class="p">);</span>

<span class="cm" style="color:rgb(153,153,136);font-style:italic">/**</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * Tears down the connection. The callback is invoked after a connection has been closed. In case of an error, an</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * Error object will be passed to the callback</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> */</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">disconnect</span><span class="p">(</span><span class="kd" style="font-weight:bold">function</span> <span class="nx">callback</span><span class="p">);</span>

<span class="cm" style="color:rgb(153,153,136);font-style:italic">/**</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * Subscribes to a channel. The callback function is invoked for every message, received on the given channel.</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> */</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="nb" style="color:rgb(0,134,179)">String</span> <span class="nx">channel</span><span class="p">,</span> <span class="kd" style="font-weight:bold">function</span> <span class="nx">callback</span><span class="p">);</span>

<span class="cm" style="color:rgb(153,153,136);font-style:italic">/**</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * Removes the subscription of the given channel.</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> */</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="nb" style="color:rgb(0,134,179)">String</span> <span class="nx">channel</span><span class="p">);</span>

<span class="cm" style="color:rgb(153,153,136);font-style:italic">/**</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> * Publishes a message to a given channel</span>
<span class="cm" style="color:rgb(153,153,136);font-style:italic"> */</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">publish</span><span class="p">(</span><span class="nb" style="color:rgb(0,134,179)">String</span> <span class="nx">channel</span><span class="p">,</span> <span class="nb" style="color:rgb(0,134,179)">Object</span> <span class="nx">message</span><span class="p">);</span>
</pre></div><p style="margin:15px 0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">Perhaps a&nbsp;<em>STATE-MASHINE</em>&nbsp;would be nice as well:</p><div class="highlight" style="background-color:rgb(255,255,255);border:0px;padding:0px;font-family:Helvetica,arial,freesans,clean,sans-serif;font-size:13.63636302947998px;line-height:20px">
<pre style="font-size:13px;line-height:19px;font-family:Consolas,'Liberation Mono',Courier,monospace;word-wrap:break-word;margin-top:15px;margin-bottom:15px;background-color:rgb(248,248,248);border:1px solid rgb(204,204,204);overflow:auto;padding:6px 10px;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">CONNECTING</span> <span class="o" style="font-weight:bold">=</span> <span class="mi" style="color:rgb(0,153,153)">0</span><span class="p">;</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">OPEN</span> <span class="o" style="font-weight:bold">=</span> <span class="mi" style="color:rgb(0,153,153)">1</span><span class="p">;</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">CLOSING</span> <span class="o" style="font-weight:bold">=</span> <span class="mi" style="color:rgb(0,153,153)">2</span><span class="p">;</span>
<span class="nx">AeroGear</span><span class="p">.</span><span class="nx">Notifier</span><span class="p">.</span><span class="nx">CLOSED</span> <span class="o" style="font-weight:bold">=</span> <span class="mi" style="color:rgb(0,153,153)">3</span><span class="p">;</span>
</pre></div><h2 style="margin:20px 0px 10px;padding:0px;font-size:24px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(204,204,204);font-family:Helvetica,arial,freesans,clean,sans-serif"><a name="implementation-of-the-adapters" class="anchor" href="https://gist.github.com/matzew/bd4f3c41e1114c225eb1#implementation-of-the-adapters" style="color:rgb(65,131,196);text-decoration:initial;display:block;padding-left:30px" target="_top" rel="nofollow" link="external"></a>Implementation of the Adapters</h2><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; ">The different adapter implementations will be done separately:&nbsp;<code style="font-size:12px;line-height:normal;font-family:Consolas,'Liberation Mono',Courier,monospace;margin:0px 2px;padding:0px 5px;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;white-space:nowrap">ag-notifier-vertx.js</code>...</div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; ">
<br></div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; ">Thoughts ?</div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; ">
<br></div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-left: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 13.63636302947998px; line-height: 20px; margin-bottom: 0px !important; ">
<br></div><br>-- <br>Matthias Wessendorf<br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_top" rel="nofollow" link="external">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_top" rel="nofollow" link="external">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_top" rel="nofollow" link="external">http://twitter.com/mwessendorf</a><br>
<br>_______________________________________________
<br>aerogear-dev mailing list
<br>&lt;a href=&quot;x-msg://237/user/SendEmail.jtp?type=node&amp;amp;node=1694&amp;amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot; link=&quot;external&quot;&gt;[hidden email]</a>
<br><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a>

        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1">
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-AeroGear-Notifier-Client-API-tp1694.html" target="_top" rel="nofollow" link="external">http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-AeroGear-Notifier-Client-API-tp1694.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from aerogear-dev, <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://aerogear-dev.1069024.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&amp;breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>
        </div></blockquote></div><br>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://aerogear-dev.1069024.n5.nabble.com/Re-aerogear-dev-AeroGear-Notifier-Client-API-tp1815.html">Re: [aerogear-dev] [AeroGear-Notifier] Client API</a><br/>
Sent from the <a href="http://aerogear-dev.1069024.n5.nabble.com/">aerogear-dev mailing list archive</a> at Nabble.com.<br/>