patch for add gevent support, thanks to Phus Lu