This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openerp | |
try: | |
import uwsgi | |
uwsgi.port_fork_hook = openerp.wsgi.core.on_starting | |
except: | |
openerp.wsgi.core.on_starting() | |
# Equivalent of --load command-line option | |
openerp.conf.server_wide_modules = ['web'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openerp | |
import uwsgi | |
def foobar(): | |
print "ciao" | |
openerp.conf.server_wide_modules = ['web'] | |
openerp.wsgi.core.on_starting(None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r c245ac034d7c master_utils.c | |
--- a/master_utils.c Tue May 15 08:59:08 2012 +0200 | |
+++ b/master_utils.c Wed May 16 10:20:52 2012 +0200 | |
@@ -267,6 +267,17 @@ | |
uwsgi_sock = uwsgi_sock->next; | |
} | |
+ uwsgi_sock = uwsgi.shared_sockets; | |
+ while (uwsgi_sock) { | |
+ if (i == uwsgi_sock->fd) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r c245ac034d7c plugins/python/python_plugin.c | |
--- a/plugins/python/python_plugin.c Tue May 15 08:59:08 2012 +0200 | |
+++ b/plugins/python/python_plugin.c Wed May 16 10:21:54 2012 +0200 | |
@@ -249,6 +249,8 @@ | |
void uwsgi_python_atexit() { | |
+ if (uwsgi.mywid == -1) goto realstuff; | |
+ | |
// if hijacked do not run atexit hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $app = sub { | |
my $env = shift; | |
$env->{'psgi.input'}->read(my $buf, 4096); | |
print $buf."\n" ; | |
return [ | |
'200', | |
[ 'Content-Type' => 'text/html' ], | |
[ "<h1>Hello World</h1>" ], | |
]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
class AAA(threading.Thread): | |
def run(self): | |
while 1: | |
print "A" | |
a = AAA() | |
a.start() | |
def application(e,s): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
import gevent_psycopg2 | |
gevent_psycopg2.monkey_patch() | |
def application(e, s): | |
conn = psycopg2.connect("dbname='foobar' user='postgres'") | |
print conn | |
cur = conn.cursor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
; create the socket 0 (uwsgi protocol) | |
socket = 127.0.0.1:3031 | |
; create the socket 1 (HTTP protocol) | |
http-socket = 127.0.0.1:8080 | |
; spawn the master | |
master = true | |
; spawn 4 processes | |
processes = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 32dd588a5e23 pypy/goal/targetpypystandalone.py | |
--- a/pypy/goal/targetpypystandalone.py Fri May 17 16:41:25 2013 -0700 | |
+++ b/pypy/goal/targetpypystandalone.py Sat May 18 13:03:29 2013 +0200 | |
@@ -10,6 +10,8 @@ | |
from rpython.config.config import ConflictConfigError | |
from pypy.tool.option import make_objspace | |
from pypy.conftest import pypydir | |
+from rpython.rlib import rthread | |
+from pypy.module.thread import os_thread | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 5e25ae4de748 pypy/goal/targetpypystandalone.py | |
--- a/pypy/goal/targetpypystandalone.py Sat May 18 13:31:35 2013 +0200 | |
+++ b/pypy/goal/targetpypystandalone.py Sat May 18 19:46:43 2013 +0200 | |
@@ -129,7 +129,12 @@ | |
@entrypoint('main', [], c_name='pypy_thread_attach') | |
def pypy_thread_attach(): | |
+ os_thread.setup_threads(space) | |
+ os_thread.bootstrapper.acquire(space, None, None) | |
rthread.gc_thread_start() |
OlderNewer