Пример #1
0
def make(port, settings, path):
    '''Create the application serving a django site'''
    server = txweb.Server(TxWSGIHandler, port, pool = getpool(0))
    server.build()
    media = settings.MEDIA_URL
    if media and not media.startswith('http'):
        django_media(server.root,settings,path)
    return server
Пример #2
0
 def __init__(self, handler, port = 0, pool = None,
              withpool = False, reactor_type = None,
              **kwargs):
     super(Server,self).__init__(handler, port, **kwargs)
     self.pool = pool
     self.reactor_type = reactor_type
     if pool is None and withpool:
         self.pool = getpool(0)
         pool = self.pool
Пример #3
0
def txserve(port,threads):
    from unuk.contrib import txweb
    from unuk.concurrency import getpool
    pool = getpool(0,threads)
    txweb.Server(site(),port,pool=pool).serve()
Пример #4
0
 def setUp(self):
     pool = getpool(self.withpool)
     self.controller = Controller(pool=pool, task_modules=["{0}.*".format(self.taskdir)], beat=0.5)
     self.controller.start()
     self.scheduler = self.controller.scheduler
     self.registry = registry