forked from meebo/pistil
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi,
With gevent dev (github master) and pistil, the following example code doesn't start:
import mimetypes
import os
from gevent import monkey
monkey.noisy = False
monkey.patch_all()
from pistil import util
from pistil.tcp.arbiter import TcpArbiter
from pistil.tcp.gevent_worker import TcpGeventWorker
class HttpWorker(TcpGeventWorker):
def handle(self, sock, addr):
sock.sendall("hallo\n")
def main():
conf = {"address": ("127.0.0.1", 5000), "debug": True,
"num_workers": 3}
spec = (HttpWorker, 30, "send_file", {}, "worker",)
arbiter = TcpArbiter(conf, spec)
arbiter.run()
if __name__ == '__main__':
main()It gives the following error:
Traceback (most recent call last):
File "zzz.py", line 11, in
from pistil.tcp.gevent_worker import TcpGeventWorker
File "/usr/local/lib/python2.7/site-packages/pistil-0.2.0-py2.7.egg/pistil/tcp/gevent_worker.py", line 42, in
class TcpGeventWorker(TcpSyncWorker):
File "/usr/local/lib/python2.7/site-packages/pistil-0.2.0-py2.7.egg/pistil/tcp/gevent_worker.py", line 77, in TcpGeventWorker
if hasattr(gevent.core, 'dns_shutdown'):
AttributeError: 'module' object has no attribute 'core'
Adding
import gevent.core
to pistil/tcp/gevent_worker.py fixes this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels