Daniele Varrazzo avatar Daniele Varrazzo committed 32cb37c

Function make_psycopg_green() renamed to patch_psycopg()

Comments (0)

Files changed (5)

 .. __: http://eventlet.net/doc/patching.html#monkeypatching-the-standard-library
 
 If for any reason you want to avoid using Eventlet monkeypatching you can use
-``psycogreen.eventlet.make_psycopg_green()``.
+``psycogreen.eventlet.patch_psycopg()``.
 
-Function ``psycogreen.eventlet.make_psycopg_green()``
+Function ``psycogreen.eventlet.patch_psycopg()``
     Enable async processing in Psycopg integrated with the Eventlet events
     loop.  It is performed by registering ``eventlet_wait_callback()`` as
     psycopg2 wait callback.
 ----------------------------
 
 In order to use psycopg2 asynchronously with `gevent`_ you can use
-``psycogreen.gevent.make_psycopg_green()``.
+``psycogreen.gevent.patch_psycopg()``.
 
-Function ``psycogreen.gevent.make_psycopg_green()``
+Function ``psycogreen.gevent.patch_psycopg()``
     Enable async processing in Psycopg integrated with the gevent events
     loop.  It is performed by registering ``gevent_wait_callback()`` as
     psycopg2 wait callback.

psycogreen/eventlet.py

 """A wait callback to allow psycopg2 cooperation with eventlet.
 
-Use `make_psycopg_green()` to enable eventlet support in Psycopg.
+Use `patch_psycopg()` to enable eventlet support in Psycopg.
 """
 
 # Copyright (C) 2010-2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
 
 from eventlet.hubs import trampoline
 
-def make_psycopg_green():
+def patch_psycopg():
     """Configure Psycopg to be used with eventlet in non-blocking way."""
     if not hasattr(extensions, 'set_wait_callback'):
         raise ImportError(

psycogreen/gevent.py

 """A wait callback to allow psycopg2 cooperation with gevent.
 
-Use `make_psycopg_green()` to enable gevent support in Psycopg.
+Use `patch_psycopg()` to enable gevent support in Psycopg.
 """
 
 # Copyright (C) 2010-2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
 
 from gevent.socket import wait_read, wait_write
 
-def make_psycopg_green():
+def patch_psycopg():
     """Configure Psycopg to be used with gevent in non-blocking way."""
     if not hasattr(extensions, 'set_wait_callback'):
         raise ImportError(

tests/test_eventlet.py

 eventlet.monkey_patch()
 
 import psycogreen.eventlet
-psycogreen.eventlet.make_psycopg_green()
+psycogreen.eventlet.patch_psycopg()
 
 import urllib2  # green
 

tests/test_gevent.py

 gevent.monkey.patch_all()
 
 import psycogreen.gevent
-psycogreen.gevent.make_psycopg_green()
+psycogreen.gevent.patch_psycopg()
 
 import urllib2  # green
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.