Skip to main content

Run WSGI applications with PasteDeploy and gevent.

Project description

With pastegevent package you can run your WSGI applications on top of gevent’s high performace HTTP server.

Configuration

Just use egg:pastegevent#gevent as use directive value of your server configuration section:

[server:main]
use = egg:pastegevent#gevent

If you need to pastegevent to monkey patch stdlib modules for you, use egg:pastegevent#gevent_patched. This will monkey patch all, except DNS subsystem:

[server:main]
use = egg:pastegevent#gevent_patched

But no DNS patching is performed due to inability to reinitialize libevent’s DNS subsystem after forking.

Using of asynchronous DNS resolving with evdns

If your application relies heavy on asyncronous DNS resolving, you probably still need to patch stdlib to use evdns to resolve domain names. Fortunately there are few steps to workaround issue with evdns initialization.

First thing to do is to be sure not not make any network interactions before server startup, so libevent (and its DNS subsystem in particular) will be not be initialized before daemonization. That means no network code in WSGI application factory.

Then you should configure server to use non-patched version of gevent server factory:

[server:main]
use = egg:pastegevent#gevent

and patch DNS yourself in application factory:

def app(global_config, **settings):
    from gevent.monkey import patch_all
    patch_all()
    return wsgi_app

Now your application can take the advantages of asyncronous DNS resolving.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pastegevent-0.1.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

pastegevent-0.1-py2.6.egg (3.0 kB view details)

Uploaded Source

File details

Details for the file pastegevent-0.1.tar.gz.

File metadata

  • Download URL: pastegevent-0.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pastegevent-0.1.tar.gz
Algorithm Hash digest
SHA256 bbcfa32358e44d21607260073f8aa577978decc53e01c35558e384721fd2e76b
MD5 7b26fed0f31f9bc0865e5c648ad6e787
BLAKE2b-256 e6b8e742b553f167ddfa0b05a04c6fbb18052e499560dab46fb3096ff9513133

See more details on using hashes here.

File details

Details for the file pastegevent-0.1-py2.6.egg.

File metadata

File hashes

Hashes for pastegevent-0.1-py2.6.egg
Algorithm Hash digest
SHA256 01c74da9a662151bb3b9aae9482566cbe540db4991762f1d7209774cf788126e
MD5 49d2ef6ff7ff54e0bf66260bb6463d42
BLAKE2b-256 10edb1bdb56081fa9966f270adde00be7a5370a106096a6a1819a1b57175c4f1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page