Exemplo n.º 1
0
def server():
    wm = ws.WebSocket('/', EchoRPC())
    app = wsgi.WsgiHandler(middleware=[wm])
    return wsgi.WSGIServer(callable=app)
Exemplo n.º 2
0
 def testBuildWsgiApp(self):
     appserver = wsgi.WSGIServer()
     self.assertEqual(appserver.name, 'wsgi')
     self.assertEqual(appserver.callable, None)
Exemplo n.º 3
0
def server(callable=None, **params):
    return wsgi.WSGIServer(Site(), **params)
Exemplo n.º 4
0
def server(**kwargs):
    return wsgi.WSGIServer(Site(), **kwargs)
Exemplo n.º 5
0
def server(description=None, **kwargs):
    '''Create the :class:`.WSGIServer` running :func:`hello`.'''
    description = description or 'Pulsar Hello World Application'
    return wsgi.WSGIServer(hello, description=description, **kwargs)
Exemplo n.º 6
0
#!/usr/bin/python
"""WSGI server example"""
from __future__ import print_function

from pulsar.apps import wsgi
from pulsar.apps.wsgi import route


class Rout(wsgi.Router):
    @route('/game/', mothod='post')
    def game(self, request):
        print(request)
        return 'haha'


class Site(wsgi.LazyWsgi):
    def setup(self, environ):
        router = Rout('/')
        return wsgi.WsgiHandler([router])


if __name__ == '__main__':
    print('Serving on 8087...')
    wsgi.WSGIServer(Site()).start()
Exemplo n.º 7
0
def server(callable=None, name=None, **kwargs):
    name = name or 'wsgi'
    return wsgi.WSGIServer(callable=WebChat(name), name=name, **kwargs)
Exemplo n.º 8
0
def run():
    wsgi.WSGIServer(callable=Site(),
                    workers=config.worker_count,
                    thread_workers=config.thread_worker_count,
                    bind=(config.host + ":" + config.port)).start()
Exemplo n.º 9
0
def server(pyparser=False, **kwargs):
    return wsgi.WSGIServer(callable=Site(pyparser), **kwargs)
Exemplo n.º 10
0
def server(name='webmail', callable=None, **kwargs):
    return wsgi.WSGIServer(name=name, callable=WebMail(), **kwargs)
Exemplo n.º 11
0
def server(**kwargs):
    return wsgi.WSGIServer(callable=Site(), **kwargs)
Exemplo n.º 12
0
def server(description=None, **kwargs):
    description = description or 'Pulsar HttpBin'
    return wsgi.WSGIServer(Site(), description=description, **kwargs)