•  

Sessions at PyCon US 2012 aboutĀ Gevent

Your current filters are…

Wednesday 7th March 2012

  • The real-time web with co-routines

    by John Anderson

    Learn how to build fast and interactive web applications using a wsgi compliant web framework and co-routines. Utilizing Redis/ZeroMQ, Socket.IO, and GEvent you will learn how to build a responsive and concurrent web app while maintaining good test coverage.

    We will build a collaborative todo list system that will show you how to utilize Python, Redis/ZeroMQ, Socket.io, and GEvent for real-time communication.

    We will focus on the following topics:

    Using a wsgi framework to build a RESTful interface and hooking up socket.io to it.
    Using socketio and redis/zeromq for subscribing to named channels and communicating in real-time over websockets.
    Gevent
    Testing your real-time application
    Deployment and Monitoring
    A rough outline
    GEvent (30 min)

    Intro to GEvent and co-routines, what it is, how it works, the benefits of using it, and how simple it is to wrap your mind around a co-routine vs the callback methodology of threads.

    ZeroMQ / Redis (30 min)

    Intro to pub/sub, the communication model we'll use for our realtime communication and how to utilize ZeroMQ or Redis to achieve this.

    Socket.IO and Backbone.js (30 min)

    Discussion of Polling, Longpolling, Flash sockets, and web sockets and the benefits of each and how Socket.IO lets us not care. I will discuss how to get socket.io client side working with the server side.

    Testing (15 min)

    We will cover how to architect your co-routine based applications to make them easily testable and how to utilize mock to make things easier. We will cover the gotcha's of testing GEvent based code.

    Deployment (15 min)

    The final portion of the tutorial we discuss deployment and how to manage and monitor your WSGI server that is using GEvent patched libraries. This will cover basics on which webservers to use as well as exception handling.

    We leave 30minutes of leeway to further discussion in a certain area that the students are most interested in as well as for questions on things specific that they feel I may not have covered so far.

    I will provide the non-realtime code base for the application we will be working on and we will start from there and slowly add in support for the realtime communication as we discuss the technologies needed.

    Most introductions to the web with gevent just show a basic chat application which leaves a lot of questions about where to go next once you are building a real application and I hope to cover all of those in this tutorial.

    At 1:20pm to 4:40pm, Wednesday 7th March

    In F2, Santa Clara Convention Center

Friday 9th March 2012

  • Throwing Together Distributed Services With Gevent

    by Jeff Lindsay

    In this talk we learn how to throw together a distributed system using gevent and a simple framework called gservice. We'll go from nothing to a distributed messaging system ready for production deployment based on experiences building scalable, distributed systems at Twilio.

    As some have found, gevent is one of the best kept secrets of Python. It gives you fast, evented network programming without messes of callbacks, code that is more Pythonic, and lets you use most regular Python networking libraries and protocol implementations. Now, let's build on this.

    In this talk we learn how to throw together distributed services using gevent and a simple framework called gservice. We'll go from nothing to a distributed messaging system based on experiences building scalable, distributed systems at Twilio.

    This talk will be full of code, live coding, and real production applications with guest appearances by other fun technologies like ZeroMQ, WebSocket, and Doozer.

    At 2:40pm to 3:20pm, Friday 9th March

    In E4, Santa Clara Convention Center

    Coverage video