I'm starting out with rethinkdb
in python
, and taking a look at the different approaches:
- Blocking approach with threads
- Non-blocking, callback-based approach with
Tornado
- Greenlet-based approach with
gevent
In the first case, the natural thing to do is to give each thread a connection
object. In the second and third cases, however, I don't quite get it.
With tornado and gevent, how and when should I create connections? How many should I have around?