16
CSC Knowledge Summit 4/2015 Language Agnostic Technologies introduced in pi-web-agent 0.4rc2 Speaker: Andreas Galazis

Language agnostic technologies introduced in pi web-agent 0.4rc2

Embed Size (px)

Citation preview

Page 1: Language agnostic technologies  introduced in pi web-agent 0.4rc2

CSC Knowledge Summit 4/2015

Language Agnostic Technologies introduced in pi-web-agent 0.4rc2

Speaker:Andreas Galazis

Page 2: Language agnostic technologies  introduced in pi web-agent 0.4rc2

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.

Page 3: Language agnostic technologies  introduced in pi web-agent 0.4rc2

First couple of problems

We need low latency communication between the client and the server

We need full duplex communication between the server

Page 4: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Previous solutionsRegular http requests:

Page 5: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Previous solutionsAjax Polling

Page 6: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Solution: Html5 WebSockets

Page 7: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Problem solved?

NO!

Page 8: Language agnostic technologies  introduced in pi web-agent 0.4rc2

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.

Page 9: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Problem not solved yet!

Page 10: Language agnostic technologies  introduced in pi web-agent 0.4rc2

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.”

Page 11: Language agnostic technologies  introduced in pi web-agent 0.4rc2

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?

Page 12: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Problem not solved yet!

Page 13: Language agnostic technologies  introduced in pi web-agent 0.4rc2

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

Page 14: Language agnostic technologies  introduced in pi web-agent 0.4rc2

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

Page 15: Language agnostic technologies  introduced in pi web-agent 0.4rc2

Questions?

Page 16: Language agnostic technologies  introduced in pi web-agent 0.4rc2

References● rabbitmq - Provides robust messaging for applications!● websocketd - WebSockets the UNIX way!● websocketdBro - Combines rabbitmq and websocketd to support message broadcasting