benoitc/couchdbkit — Issue #108: couchdbkit loses connection after couchdbkit.Consumer.wait_async()
Author: rogutes
Created: 2011-11-10 21:07:31+00:00
State: open

Running this code:

```
import couchdbkit

def show_changes(line):
print line

s = couchdbkit.Server('https://localhost:6984')
db = s.get_db('control')

c = couchdbkit.Consumer(db, backend='gevent')
c.wait_async(show_changes)

s.all_dbs()
```

Gives us this traceback:
```python
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/couchdbkit/client.py", line 122, in all_dbs
return self.res.get('/_all_dbs').json_body
File "/usr/lib/python2.7/site-packages/restkit/resource.py", line 114, in get
params_dict=params_dict, **params)
File "/usr/lib/python2.7/site-packages/couchdbkit/resource.py", line 111, in request
payload=payload, headers=headers, **params)
File "/usr/lib/python2.7/site-packages/restkit/resource.py", line 190, in request
headers=self.make_headers(headers))
File "/usr/lib/python2.7/site-packages/restkit/client.py", line 463, in request
return self.perform(request)
File "/usr/lib/python2.7/site-packages/restkit/client.py", line 423, in perform
raise RequestError("socket.error: %s" % str(e))
restkit.errors.RequestError: socket.error: Can't connect to ('localhost', 6984)
```

Note that I am not absolutely sure how wait_async() is supposed to be used.