Exemple #1
0
 def __call__(self, options, args):
     name, cmd = args
     from accost.wsgiserver import CherryPyWSGIServer
     server = CherryPyWSGIServer((options.host, options.port),
             self.application, options.threads_number, options.server_name,
             options.max, options.size, options.timeout
         )
     try:
         server.start()
     except KeyboardInterrupt:
         server.stop()
         sys.exit(0)
Exemple #2
0
 def action( hostname            =   ('h', ''),
             port                =   ('p', 9999),
             threads             =   20,
             server_name         =   'localhost',
             max                 =   -1,
             request_queue_size  =   5,
             timeout             =   10,
     ):
     """run application use cherrypy http server"""
     from accost.wsgiserver import CherryPyWSGIServer
     server = CherryPyWSGIServer((hostname, port), application,
             threads, server_name, max, request_queue_size, timeout)
     try:
         server.start()
     except KeyboardInterrupt:
         server.stop()