Vous êtes sur la page 1sur 11

anybox

1/11
Socket.io integration : live
notifications, live kanban, instant
messaging and more!
A flexible, generic high level toolkit for OpenERP 7,
with selected applications

2/11
Why Socket.IO

Real time AI

!vent based bidirectional comm"nication

Works on every #latform, bro$ser or device

!asy and fast to "se

!asy to do long%#olling services

&no$ledge of the connection and disconnection


'heartbeat( on client and server sides

3/11
System architect"re
DB
Longpolling controller
OpenERP
Core & logic
DB
Listener
OpenERP
Server
Gevent-SocketIO Server
http proxy
Adapter
Notifies
Classical Long-polling
Browser
socket.io.js standard

4/11
)onfig"re yo"r *ginx server

5/11
Install and Start +event Server $ith b"ildo"t

6/11
Server Side : Internal notifications
web_socketio provides the needed inter process communication between
main OpenERP server and Gevent Socket.IO server.
Implementation : based on PostgreSQL notifications

7/11
Server Side : events from the client
socket.io events get fired by the client
and trigger a server-side function, such as this one :

!vent name

!vent ada#ter : #arse notifications

!vent ty#e :

, connect - : At the connexion of the socket

, on - 'defa"lt( : When the event name are called

, disconnect - : At the disconnexion of the socket


The arguments of the decorator are :

8/11
Server Side : )reate an ada#ter
Ada#ter select the internal notifications need for
one or more events.

9/11
Server Side : Session methods

emit : trigger a client side event

listen : $ait for a internal notification 'needs


ada#ter declaration(

model : get a $ra##er to an O#en!R ob.ect

notify : do an internal notification

broadcast/event : emit on all the sockets



10/11
)lient Side : 0ong#olling socket

on : declare a ne$ event.

emit : )all an event server side.


The web_longpolling module initialise the socket
instance.web.longpolling_socket

11/11
Socket.io : 1o$ contrib"te 2

htt#:33bitb"cket.org3anybox3$eb/socketio

htt#:33bitb"cket.org3anybox3$eb/notification,
'branch socketio(

htt#:33bitb"cket.org3anybox3$eb/im

htt#:33bitb"cket.org3anybox3$eb/live

htt#:33bitb"cket.org3anybox3$eb/action/re4"est
All our modules are on bitbucket

Vous aimerez peut-être aussi