programming tools. Also it looks fancy and complicated, which is why it’s in this slide def processA(data): return map(lambda x: [y ** 2 for y in x], data) def processB(data): return reduce(list.__add__, data, []) def main(data): data = processA(data) print processB(data) >>> data = [[1,2,3],[4,5,6],[7,8,9]] >>> main(data) [1, 4, 9, 16, 25, 36, 49, 64, 81]
* • Beanstalk’d • Celery (Python based) * Some are technically not message queues but for the purposes of SOA and the like, but for the purposes of this talk, let’s consider them MQs
B3 Process B2 Queue (external) MQ Management • Literally, 0 MQ (or rather, no broker) • ZeroMQ uses sockets • I think of ZeroMQ as a network stack with built in MQ
B3 Process B2 Queue (external) MQ Management Producer Broker + MQ Consumer Producer zmq Consumer zmq The Genius of The Genius of The Genius of The Genius of ZeroMQ ZeroMQ ZeroMQ ZeroMQ
>>> socket.send(‘test’) import zmq context = zmq.Context() socket = context.socket(zmq.PULL) socket.connect(‘tcp://*:1234’) while True: msg = socket.recv() print msg test If you are reading this during the presentation that means the live coding didn’t go well
talk chat app in < 10 minutes – ~ 60 lines of code with just one of the above pattern – Shows the concept of “sockets with Message Queues built- in” – See Examples
traditional message queue • To create a Service Oriented Architecture • Personally, I like the UNIX Philosophy better. 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.
– project shelved • Strangers for Dinner (http://strangersfordinner.com) – pivoting • A Brand Safety Product • A Data Management Platform • A Media Analysis Toolkit
network topology. • You cannot tack on ZeroMQ like you tack on RabbitMQ • Spread your load across many processes • Not a poor man’s distributed processing
are made, reply the user instantly with cached data. • Handle the POST information separately in the back end (by PUSHing your data to your POST handler app) • If you need to communicate results with the user, socket.io is a good idea.