Online Mind Mapping and Brainstorming

Create your own awesome maps

Online Mind Mapping and Brainstorming

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account? Log In

Async networking in Python, Uriel Katz by Mind Map: Async networking in Python, Uriel Katz
5.0 stars - 1 reviews range from 0 to 5

Async networking in Python, Uriel Katz

Greenlets in pure python

Uses libev for the event loop, libeio for file IO

Gevent

used by

has some problems, but Uriel says it's good for production

Uriel's favorite

gives you sync API on top of async networks

pluggable event loop

written in Python

thread pool built0in

monkey patching on steroids

DB API using threads

has a DBAPI 2.0 compatible MySQL driver

Doesn't seem active

Omegle.com in production

replaced Twisted

About

R&D manager at Binfire

title

with

Async networking

handling many concurrent users

basic idea

using 1 thread like this: blocking calls block all requests

in operating systems

only good for very heavy computation

Frameworks

gevent

twisted

Concurrence

Eventlet

Concurrence

libevent based with greenlets

use channels to communicate between tasklets

Eventlet

thread safe

quite slow

Websockets support

slightly slower than Gevent

Bug & messy compared to Gevent

Something extra - Node.js

Vitaly: "Erlang for poors"

Evented IO on top of Google's V8 JS engine

has async file IO

let's you write high-performance servers in JavaScirpt

parser written in Rebel

Comet-like chat examples (no-polling)

API

all users call the wait method, but the server doesn't need threads serving all waiting clients

See examples the slides http://urielkatz.com

Largest pitfall

Each greenlet must give control to next greenlets

Can't escape this - a price we need to pay

Uriel's experience with Gevent

patches to pywsgi

waitany function

stuff done in work

what is this???

Doesn't have a standard socke implementation & no monkey-patchng support

New node

Новый узел

Новый узел