Show More
@@ -26,6 +26,26 b' class EchoApp(object):' | |||||
26 | return ["ECHO"] |
|
26 | return ["ECHO"] | |
27 |
|
27 | |||
28 |
|
28 | |||
|
29 | class EchoAppStream(object): | |||
|
30 | ||||
|
31 | def __init__(self, repo_path, repo_name, config): | |||
|
32 | self._repo_path = repo_path | |||
|
33 | log.info("EchoApp initialized for %s", repo_path) | |||
|
34 | ||||
|
35 | def __call__(self, environ, start_response): | |||
|
36 | log.debug("EchoApp called for %s", self._repo_path) | |||
|
37 | log.debug("Content-Length: %s", environ.get('CONTENT_LENGTH')) | |||
|
38 | environ['wsgi.input'].read() | |||
|
39 | status = '200 OK' | |||
|
40 | headers = [('Content-Type', 'text/plain')] | |||
|
41 | start_response(status, headers) | |||
|
42 | ||||
|
43 | def generator(): | |||
|
44 | for _ in xrange(1000000): | |||
|
45 | yield "ECHO" | |||
|
46 | return generator() | |||
|
47 | ||||
|
48 | ||||
29 | def create_app(): |
|
49 | def create_app(): | |
30 | """ |
|
50 | """ | |
31 | Allows to run this app directly in a WSGI server. |
|
51 | Allows to run this app directly in a WSGI server. |
General Comments 0
You need to be logged in to leave comments.
Login now