Upload
andreas-galazis
View
181
Download
1
Embed Size (px)
Citation preview
CSC Knowledge Summit 4/2015
Language Agnostic Technologies introduced in pi-web-agent 0.4rc2
Speaker:Andreas Galazis
So are you going to talk about Message queues?Not exactly ...You'll see that the problem we are trying to solve is not directly related with the purpose of message queues.
First couple of problems
We need low latency communication between the client and the server
We need full duplex communication between the server
Previous solutionsRegular http requests:
Previous solutionsAjax Polling
Solution: Html5 WebSockets
Problem solved?
NO!
Pi Web Agent is A PlatformWhat’s the point of having a platform?(unified development process/attract different developers )I can build my own websocket server.There exist a variety of modules/libraries that can provide websocket support for each language. What about newcomers that have to figure out what they should use?
Try to build web socket server to serve your bash script.Try to plug websockets to an existing application on your linux machine.
Problem not solved yet!
Websocketd
It's like CGI, twenty years later, for WebSocketsA web socket daemon for unix machines
-Doug McIlroy inventor of the Unix pipe
“Write programs that do one thing and do it well.Write programs to work together.
Write programs to handle text streams,because that is a universal interface.”
Websocketd
“Write programs that do one thing and do it well!”Websocketd really does one thing...
For every connection :Run one instance of your application with its stdin/stdout converted to bidirectional websocket communicationWhat if you want to broadcast your messages?
Problem not solved yet!
Publish/Subscribe message queue-fanout
In our case rabbitMQ was usedThe scenariocomponents:
● Producer: user application that sends messages.● Exchange: receives messages from producers
and it pushes them to queues● Queue: a buffer that stores messages.● Consumer: application that receives messages.
Bindings: the relationship between the exchange and the que
bb
Putting it all together:WebsocketdBroSo do people need to care about using the two technologies together?WebsocketdBro( a websocketd broadcaster):
your app
Websocketdruns consumers
Browser Browser
Questions?
References● rabbitmq - Provides robust messaging for applications!● websocketd - WebSockets the UNIX way!● websocketdBro - Combines rabbitmq and websocketd to support message broadcasting