Klaus Demo bjoern / d2f0a26
Some tweaks Jonas Haag 9 years ago
2 changed file(s) with 4 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3636 static PyObject*
3737 run(PyObject* self, PyObject* args)
3838 {
39 if(PyArg_ParseTuple(args, "")) {
39 if(PyTuple_GET_SIZE(args) == 0) {
4040 // bjoern.run()
4141 if(!wsgi_app) {
4242 PyErr_SetString(
4343 PyExc_RuntimeError,
44 "Must call bjoern.listen(app, host, port) before calling bjoern.run() w/o arguments."
44 "Must call bjoern.listen(app, host, port) before "
45 "calling bjoern.run() without arguments."
4546 );
4647 return NULL;
4748 }
77
88 def app(environ, start_response):
99 start_response('200 OK', [])
10 yield 'Hello world'
10 yield 'Hello world from worker %d' % os.getpid()
1111
1212
1313 bjoern.listen(app, '0.0.0.0', 8080)