際際滷

際際滷Share a Scribd company logo
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 solutions
Regular http requests:
Previous solutions
Ajax Polling
Solution: Html5 WebSockets
Problem solved?
NO!
Pi Web Agent is A Platform
Whats 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 WebSockets
A 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 communication
What if you want to broadcast your messages?
Problem not solved yet!
Publish/Subscribe message queue-fanout
In our case rabbitMQ was used
The scenario
components:
 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
Putting it all together:WebsocketdBro
So do people need to care about using the two technologies
together?
WebsocketdBro( a websocketd broadcaster):
your app
Websocketd
runs 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

More Related Content

Language agnostic technologies introduced in pi web-agent 0.4rc2

  • 1. CSC Knowledge Summit 4/2015 Language Agnostic Technologies introduced in pi-web-agent 0.4rc2 Speaker: Andreas Galazis
  • 2. 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.
  • 3. First couple of problems We need low latency communication between the client and the server We need full duplex communication between the server
  • 8. Pi Web Agent is A Platform Whats 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.
  • 10. Websocketd It's like CGI, twenty years later, for WebSockets A 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.
  • 11. 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 communication What if you want to broadcast your messages?
  • 13. Publish/Subscribe message queue-fanout In our case rabbitMQ was used The scenario components: 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
  • 14. Putting it all together:WebsocketdBro So do people need to care about using the two technologies together? WebsocketdBro( a websocketd broadcaster): your app Websocketd runs consumers Browser Browser
  • 16. References rabbitmq - Provides robust messaging for applications! websocketd - WebSockets the UNIX way! websocketdBro - Combines rabbitmq and websocketd to support message broadcasting