Powering Convore

Congratulations to Eric Florenzano and the entire Convore team for their launch last week and the buzz they’ve been able to build about their product already.  That’s awesome!

I couldn’t help but note that Eric’s posted about the technology powering Convore, and guess what little library is listed there?  That’s right, Django.

Seriously though, it’s nice to see someone using such a seemingly-oldschool stack to build a cutting-edge application and not being apologetic about it at all.  And this is a great illustration of the sweet spot for Eventlet: quickly creating a novel scalable network application.

0.9.14 Out

A good way to start off the week! This release contains numerous
bugfixes that have been contributed by excellent people since the last
release. It’s the best version of Eventlet ever!

Install it by one of these methods:

 

To file issues/bugs:
http://bitbucket.org/which_linden/eventlet/issues/new/

Here’s the changes in this version:

  • Many fixes to the ZeroMQ hub, which now requires version 2.0.10 or later. Thanks to Ben Ford.
  • ZeroMQ hub no longer depends on pollhub, and thus works on Windows (thanks, Alexey Borzenkov)
  • Better handling of connect errors on Windows, thanks again to Alexey Borzenkov and Nat Linden (#67, #69).
  • More-robust Event delivery, thanks to Malcolm Cleaton
  • wsgi.py now distinguishes between an empty query string (“”) and a non-existent query string (no entry in environ).
  • wsgi.py handles ipv6 correctly (thanks, redbo)
  • Better behavior in tpool when you give it nonsensical numbers, thanks to R. Tyler for the nonsense. :)
  • Fixed importing on 2.5 (#73, thanks to Ruijun Luo)
  • Hub doesn’t hold on to invalid fds (#74, thanks to Edward George)
  • Documentation for eventlet.green.zmq, courtesy of Ben Ford

The md5sum for the tarball is dfc96ed14b27392fdc529abcafeed880
The sha256sum is
219207d165176b12565e7f8f40aaadb2965814ce5935dba1097083d0f183bf28
(that’s right, I totally went there!)

0.9.13 out!

It’s been too long, hasn’t it? The major new things of interest in this release are the ZeroMQ support, eventlet.green.MySQLdb, and greenthread affinity in tpool. Please try out all three of these new features and file issues if you find bugs!

How get it:

File issues/bugs here.

Full changelog:

  • ZeroMQ hub, and eventlet.green.zmq make supersockets green. Thanks to Ben Ford! Check out the examples zmq_chat.py and
    distributed_websocket_chat.py.
  • eventlet.green.MySQLdb added. It’s an interface to MySQLdb that uses tpool to make it appear nonblocking
  • Greenthread affinity in tpool. Each greenthread is assigned to the same thread when using tpool, making it easier to work with
    non-thread-safe libraries.
  • Eventlet now depends on greenlet 0.3 or later.
  • Fixed a hang when using tpool during an import causes another import. Thanks to mikepk for tracking that down.
  • Improved websocket draft 76 compliance, thanks to Nick V.
  • Rare greenthread.kill() bug fixed, which was probably brought about by a bugfix in greenlet 0.3.
  • Easy_installing eventlet should no longer print an ImportError about greenlet
  • Support for serving up SSL websockets, thanks to chwagssd for reporting #62
  • eventlet.wsgi properly sets ‘wsgi.url_scheme’ environment variable to ‘https’, and ‘HTTPS’ to ‘on’ if serving over ssl
  • Blocking detector uses setitimer on 2.6 or later, allowing for sub-second block detection, thanks to rtyler.
  • Blocking detector is documented now, too
  • socket.create_connection properly uses dnspython for nonblocking dns. Thanks to rtyler.
  • Removed EVENTLET_TPOOL_DNS, nobody liked that. But if you were using it, install dnspython instead. Thanks to pigmej and gholt.
  • Removed _main_wrapper from greenthread, thanks to Ambroff adding keyword arguments to switch() in 0.3!

The md5sum of the tarball is 2273527ca1715bad018090fdd2d480cf.

Blocking Detection Article

Check out R. Tyler’s post on blocking detection in Eventlet.  It’s good stuff — if you’re concerned about performance under load, detecting places where your code blocks should be your first order of business.  Here’s the official documentation on enabling blocking detection.

Using signals is kind of appropriate for this sort of functionality, because signals are part of a sorta old-school way of implementing concurrency.  The nice thing about them versus, say, a watchdog thread, is that the Python interpreter really interrupts itself in the middle of whatever it was doing when the signal comes in, so the handler can print the lowest-level line of code that was blocking.

Eventlet 0.9.12 released

Hey there, it’s another release of Eventlet! This is a pretty short changelog, but if you’re using Eventlet with the Twisted hub, you may wish to look this over (and let me know who you are, by the way, I’d like to know who’s out there using Twisted).

* Eventlet no longer uses the Twisted hub if Twisted is imported — you must call eventlet.hubs.use_hub(‘twistedr’) if you want to use it. This prevents strange race conditions for those who want to use both Twisted and Eventlet separately. * Removed circular import in twistedr.py
* Added websocket multi-user chat example
* Not using exec() in green modules anymore.
* eventlet.green.socket now contains all attributes of the stdlib socket module, even those that were left out by bugs.
* Eventlet.wsgi doesn’t call print anymore, instead uses the logfiles for everything (it used to print exceptions in one place). * Eventlet.wsgi properly closes the connection when an error is raised * Better documentation on eventlet.event.Event.send_exception
* Adding websocket.html to tarball so that you can run the examples without checking out the source

Enjoy!

The MD5 of the tarball is: 96edb9eb4f73863f3d19afb5d5c85854

0.9.10 out!

This is a stability release. There’s naught new except for greendns, which is probably not going to affect most people because most people don’t have dnspython installed already. But you should install it! Because it makes your dns queries non-blocking and snappy. Here’s the changelog:

0.9.10
======
* Greendns: if dnspython is installed, Eventlet will automatically use it to provide non-blocking DNS queries. Set the environment variable ‘EVENTLET_NO_GREENDNS’ if you don’t want greendns but have dnspython installed. * Full test suite passes on Python 2.7.
* Tests no longer depend on simplejson for >2.6.
* Potential-bug fixes in patcher (thanks to Schmir, and thanks to Hudson) * Websockets work with query strings (thanks to mcarter)
* WSGI posthooks that get called after the request completed (thanks to gholt, nice docs, too)
* Blocking detector merged — use it to detect places where your code is not yielding to the hub for > 1 second (this could use documentation) * tpool.Proxy can wrap callables
* Tweaked Timeout class to do something sensible when True is passed to the constructor

I hope you are having a sensational week!

Websocket Draft 76

A little more than a month ago, Ian Hickson released draft 76 of the WebSocket protocol, which was unusually incompatible with previous drafts.  Headers in the client upgrade request grew a Sec-Websocket prefix, and there is now an interesting challenge-response computation that needs to be performed on the headers and body.  Caveat Emptor to those who implement draft specifications, I guess!

Thus far, Chrome seems to be the major test browser for WebSockets (though Safari implements them as well), and they switched over to draft 76 a few weeks ago.  So the Chrome betas speak draft 75, and the nightlies speak 76.

Fortunately, it’s possible to write WebSocket servers that interoperate seamlessly with both versions, by detecting those new Sec-Websocket headers and doing the appropriate handshake for the appropriate version.  Andrew Godwin implemented this logic for Eventlet’s websocket module, so you can use it to serve sockets to any browser that’s out there today.  Find it in the development branch, which you can install by running easy_install eventlet==dev.

We’ll be keeping a weather eye on the spec as it proceeds.

Follow

Get every new post delivered to your Inbox.