Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's safe to patch a module wrote by pure python and using standard lib.</p> <ul> <li>there are few pure mysql adapters: <ul> <li><a href="https://launchpad.net/myconnpy" rel="nofollow">https://launchpad.net/myconnpy</a>, </li> <li><a href="https://github.com/petehunt/PyMySQL" rel="nofollow">https://github.com/petehunt/PyMySQL</a></li> </ul></li> <li>PyMysql has a sqlalchemy test suite, you could run the test for your cases.</li> <li>There is a module named pymysql_sa to provide dialect for sqlalchemy</li> <li>Flask is wrote by pure python and 100% WSGI 1.0 compliant. use <em>eventlet.wsgi</em> to provide the service.</li> </ul> <p>Divide tasks by single fetch using green module as you can. Put the jobs into a queue, which also provided by eventlet, the every task worker fetch a job from the queue, then save the result into db after finish fetching, or send to a event.Event object to trigger the job which wait for the task finish.Or, both of the two processes.</p> <p>UPDATED:</p> <p>The eventlet official document strongly recommend use the patch at the fist line of the main module, and it's safe to call monkey_patch multiple times. Read more on page <a href="http://eventlet.net/doc/patching.html" rel="nofollow">http://eventlet.net/doc/patching.html</a></p> <p>There some green module can working with eventlet, all of them are in the eventlet.green. A list on <a href="https://bitbucket.org/which_linden/eventlet/src/e2a73a7f7e45/eventlet/green" rel="nofollow">bitbucket</a>. Make sure use the green module in your code, or patch them before import 3th modules which use the standard libs.</p> <p>But the monkey_patch only accept few module, it's necessary to import the green module manually. </p> <pre>def monkey_patch(**on): """Globally patches certain system modules to be greenthread-friendly. The keyword arguments afford some control over which modules are patched. If no keyword arguments are supplied, all possible modules are patched. If keywords are set to True, only the specified modules are patched. E.g., ``monkey_patch(socket=True, select=True)`` patches only the select and socket modules. Most arguments patch the single module of the same name (os, time, select). The exceptions are socket, which also patches the ssl module if present; and thread, which patches thread, threading, and Queue. It's safe to call monkey_patch multiple times. """ accepted_args = set(('os', 'select', 'socket', 'thread', 'time', 'psycopg', 'MySQLdb')) default_on = on.pop("all",None)</pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload