Exemple #1
0
 def handle(self, *args, **options):
     if args:
         raise CommandError('pulse --help for usage')
     app_name = options.get('pulse_app_name')
     callable = Wsgi()
     if options.pop('dryrun', False) is True:  # used for testing
         return callable
     # callable.setup()
     cfg = pulsar.Config(apps=['socket', 'pulse'],
                         server_software=pulsar.SERVER_SOFTWARE,
                         **options)
     server = WSGIServer(callable=callable, name=app_name, cfg=cfg,
                         parse_console=False)
     callable.cfg = server.cfg
     server.start()
Exemple #2
0
def server(callable=None, name=None, data_store=None, **params):
    name = name or 'wsgi'
    data_store = pulsards_url(data_store)
    return WSGIServer(callable=WebChat(name),
                      name=name,
                      data_store=data_store,
                      **params)
Exemple #3
0
def server(callable=None, name=None, data_store=None, **params):
    name = name or 'wsgi'
    if not data_store:
        actor = get_actor()
        if actor:
            data_store = actor.cfg.data_store
        data_store = pulsards_url(data_store)
    return WSGIServer(callable=WebChat(name), name=name,
                      data_store=data_store, **params)
Exemple #4
0
 def handle(self, *args, **options):
     if args:
         raise CommandError('pulse --help for usage')
     name = options.get('pulse-app-name')
     callable = Wsgi()
     if options.pop('dryrun', False) is True:  # used for testing
         return callable
     callable.setup()
     WSGIServer(callable=callable,
                cfg=options,
                parse_console=False,
                name=name).start()
Exemple #5
0
def server(**kwargs):
    return WSGIServer(callable=WsgiHandler((blueprint, )), **kwargs)
Exemple #6
0
 'hypercorn':
 lambda app: run.run_single(app,
                            Config.from_mapping({
                                'host': HOST,
                                'port': PORT,
                                'debug': DEBUG,
                                'use_reloader': RELOAD
                            }),
                            loop=asyncio.get_event_loop()),
 'molten':
 lambda app: run_simple(
     HOST, PORT, app, use_debugger=DEBUG, use_reloader=RELOAD),
 'pulsar':
 lambda app: WSGIServer(callable=app,
                        load_config=False,
                        bind=f'{HOST}:{PORT}',
                        debug=DEBUG,
                        reload=RELOAD).start(),
 'pyramid':
 lambda app: run_simple(
     HOST, PORT, app, use_debugger=DEBUG, use_reloader=RELOAD),
 'quart':
 lambda app: app.run(HOST,
                     PORT,
                     debug=DEBUG,
                     use_reloader=RELOAD,
                     loop=asyncio.get_event_loop()),
 'responder':
 lambda app: app.run(address=HOST, port=PORT, debug=DEBUG),
 'sanic':
 lambda app: app.run(HOST, PORT, debug=DEBUG, auto_reload=RELOAD),
def server(**params):
    params['callable'] = Site()
    return WSGIServer(**params)