Using Python Generators In Multiplexing Servers
Stc
Date: 2008-11-20
Time: 11:00
Room: BBL room 471
Speaker: Klaas van Schelven (Xaba)
Title: Using Python Generators in Multiplexing Servers
Abstract
Friendly Flow is a multiplexing server framework for Python that
allows you to write code without callbacks.
Multiplexing Servers
Multiplexing servers serve multiple clients at the same time from a
single process. For slow tasks like I/O, control is yielded to other
client's handlers. The traditional way to yield control is "Event
Driven": A heavy task is called in a deferred manner and the handler
exits. A callback function is passed as and will be called when the
task is done. However, having to split up your program along the lines
of I/O is unnatural.
Friendly Flow allows you to write code without callbacks, just like
you would do for non-multiplexing servers. It then automagically
splits your code out to an event driven program. The python keyword
yield is used to determine where control is yielded back.