(self, options=None, capp=None, events=None,
io_loop=None, **kwargs)
| 36 | max_workers = None |
| 37 | |
| 38 | def __init__(self, options=None, capp=None, events=None, |
| 39 | io_loop=None, **kwargs): |
| 40 | handlers = default_handlers |
| 41 | if options is not None and options.url_prefix: |
| 42 | handlers = [rewrite_handler(h, options.url_prefix) for h in handlers] |
| 43 | kwargs.update(handlers=handlers) |
| 44 | super().__init__(**kwargs) |
| 45 | self.options = options or default_options |
| 46 | self.io_loop = io_loop or ioloop.IOLoop.instance() |
| 47 | self.ssl_options = kwargs.get('ssl_options', None) |
| 48 | |
| 49 | self.capp = capp or celery.Celery() |
| 50 | self.capp.loader.import_default_modules() |
| 51 | |
| 52 | self.executor = self.pool_executor_cls(max_workers=self.max_workers) |
| 53 | self.io_loop.set_default_executor(self.executor) |
| 54 | |
| 55 | self.inspector = Inspector(self.io_loop, self.capp, self.options.inspect_timeout / 1000.0) |
| 56 | |
| 57 | self.events = events or Events( |
| 58 | self.capp, |
| 59 | db=self.options.db, |
| 60 | persistent=self.options.persistent, |
| 61 | state_save_interval=self.options.state_save_interval, |
| 62 | enable_events=self.options.enable_events, |
| 63 | io_loop=self.io_loop, |
| 64 | max_workers_in_memory=self.options.max_workers, |
| 65 | max_tasks_in_memory=self.options.max_tasks) |
| 66 | self.started = False |
| 67 | |
| 68 | def start(self): |
| 69 | self.events.start() |
nothing calls this directly
no test coverage detected