Unsurprisingly, you should use it for I/O thanks to the
GIL.
spawn_link means you’re linking to a spawned greenlet?
Greenlet provides the green threads.
Sweet, glorious timeouts! Timeouts suck HARD for “real” threads.
Pool implementation; it’s so nice when langs/libs give you these
abstractions instead of rolling your own.
Event looks like fairly low-level primitives, but also multiple Queue
implementations. On a side note, why does everybody love talking about LIFO
queues instead of Stacks.
The big use-case is networking. They give you “green” versions of sockets,
select(), SSL, DNS, etc.
Good WSGI support:
gevent.wsgi wraps a C lib, doesn’t do streaming, pipelining, or
SSL
gevent.pywsgi is a little slower (does 75% of the reqs/s) but is
full-featured.
The “Real-Time Web”
No page refreshes
Server push
Examples: Chat, analytics, etc.
Implementations: Flash, polling, Web Sockets, and more!
Socket.io handles papering over all the different
implementations and picking the best one based on the browser, etc.
There’s a Gevent library to give you Socket.io support (nice!)
Supporting Code - applies the test definitions to the application under test
You can use a “Background” to declare your “globals”
Cool feature: Python’s multi-line strings
The process of applying the tests to your system is interesting. I could
explore this for quite a while, I think. Maybe I should show it to the
QA guy at work.
The actual tests run inside of nose as a plugin. It detects
.feature files as “Features” and processes them accordingly.
Parameterized testing are handled via “Scenario Outlines” (I hope it works
well, because parameterized tests are a total pain in JUnit).
It is very new (only on v0.2), so you probably want to run with the version
from GitHub.
From the Q&A
The error-handling, etc., seems to be much better than Lettuce, hence going
with it instead of Lettuce.
Brandon Writes a Program… LIVE!
PyEphem is a module that Brandon maintains and sounds cool
for astronomy buffs.