comet, simplified, with jabbify comet service
Post on 24-May-2015
799 Views
Preview:
TRANSCRIPT
Comet, Simplified, with the Jabbify Comet Service
Brian MoschelBrian MoschelJupiter IT
Why Comet?
• Demand for Comet is growing• Desktop apps moving to the web
• Chat• Real time updates• Real time updates• Don’t like to reload
• Ajax:2003::Comet:2009
What is Jabbify?
• Comet, simplified• No server• No setup• JavaScript API and GET requests• JavaScript API and GET requests
Simple to usesynchronized (_continuations) {for(Iterator<Map.Entry <String, ArrayList<Continuation>>> iter =
_continuations.entrySet().iterator(); iter.hasNext();){Map.Entry<String, ArrayList<Continuation>> entry = iter.next();ArrayList<Continuation> continuations = entry.getValue();for(Continuation c : continuations){c.resume();
}}
_continuations.clear();}}
Jabbify.connect({name: this.username}, this.continue_to('after_connect'))after_connect: function(){Jabbify.send('vote','submit', {result: this.result})
}
vs
Scale easily
• Scaling comet >> Scaling traditional web applications
• Resource intensive• Jabbify is built to scale as usage grows
Rapid Setup<New id="cf" class="org.mortbay.jetty.plus.naming.Resource"><Arg>jms/connectionFactory</Arg><Arg>
<New class="org.apache.activemq.ActiveMQConnectionFactory">
<Arg>failover:(tcp://localhost:61616)?initialReconnectDelay=20&maxReconnectDelay=900</Arg>
</New></Arg>
</New>
vs
<script language="javascript" type="text/javascript" src="jabbify.js"></script>
vs
Comet is complex• Client
– Transports (JSONP, Window.name, Flash, XHR, iframe)
• Server– Special server– Special server– Setup time– Learning curve
• Scaling– Resource consumption– Threading issues
Jabbify is simple• Client to Client Comet
– JavaScript API• Jabbify.send(“message”,”create”,{message: “hi there”});
• Server to Client Comet• Server to Client Comet– GET requests
• https://jabbify.com/message_push?key=123&type=message...
top related