lateefj / Frisky (http://src.hackingthought.com/projects/frisky/)
Frisky is an Asynchronous WSGI web server. Cross-platform, high performance, caching and compression API's included, and lightweight. Test server running Frisky: http://src.hackingthought.com/
| commit 20: | 0ebbed5016bb |
| parent 19: | df81affb701f |
| branch: | default |
11 months ago
Changed (Δ111 bytes):
TODO.txt (3 lines added, 0 lines removed)
frisky/proc.py (4 lines added, 3 lines removed)
samples/selector_sample/config.json (0 lines added, 3 lines removed)
samples/selector_sample/run.py (2 lines added, 2 lines removed)
1 |
1 |
Priorities: |
2 |
2 |
1) Worker processes |
3 |
"worker": { |
|
4 |
"processes": 2 |
|
5 |
} |
|
3 |
6 |
2) Move all configuration into configuration file |
4 |
7 |
3) Implement Request limits |
5 |
8 |
4) Support development auto reload mode |
Up to file-list frisky/proc.py:
| … | … | @@ -17,10 +17,11 @@ log = logging.getLogger(name=__name__) |
17 |
17 |
WSGI_REQUEST_POOL = None |
18 |
18 |
def create_wsgi_pool(): |
19 |
19 |
global WSGI_REQUEST_POOL |
20 |
size = |
|
20 |
size = 1 |
|
21 |
if Configuration.settings['wsgi'].has_key('processes'): |
|
22 |
size = Configuration.settings['wsgi']['processes'] |
|
21 |
23 |
WSGI_REQUEST_POOL = Pool(size) |
22 |
log.info('WSGI Request process pool created with %s proceses' % |
|
23 |
Configuration.settings['wsgi']['processes']) |
|
24 |
log.info('WSGI Request process pool created with %s proceses' % size) |
|
24 |
25 |
|
25 |
26 |
|
26 |
27 |
def handle_wsgi_request(config_file, environ, response): |
Up to file-list samples/selector_sample/config.json:
3 |
3 |
"application_callable": "run.wsgi_callable", |
4 |
4 |
"request_timeout": 30, |
5 |
5 |
"processes": 2 |
6 |
}, |
|
7 |
"worker": { |
|
8 |
"processes": 2 |
|
9 |
6 |
} |
10 |
7 |
} |
Up to file-list samples/selector_sample/run.py:
| … | … | @@ -21,10 +21,10 @@ def hello_name(environ, start_response): |
21 |
21 |
return ["Hello %s!" % name] |
22 |
22 |
|
23 |
23 |
def hello(environ, start_response): |
24 |
|
|
24 |
#print('Hello being called now...') |
|
25 |
25 |
def foo(): |
26 |
26 |
print('Working...') |
27 |
|
|
27 |
#worker.push_job(foo) |
|
28 |
28 |
return ["Hello from Frisky Selector sample"] |
29 |
29 |
|
30 |
30 |
def wsgi_callable(): |
