MCPcopy Create free account
hub / github.com/dchevell/flask-executor / _make_executor

Method _make_executor

flask_executor/executor.py:108–119  ·  view source on GitHub ↗
(self, app)

Source from the content-addressed store, hash-verified

106 app.extensions[self.name + 'executor'] = self
107
108 def _make_executor(self, app):
109 executor_type = app.config[self.EXECUTOR_TYPE]
110 executor_max_workers = app.config[self.EXECUTOR_MAX_WORKERS]
111 if executor_max_workers is not None:
112 executor_max_workers = int(executor_max_workers)
113 if executor_type == 'thread':
114 _executor = concurrent.futures.ThreadPoolExecutor
115 elif executor_type == 'process':
116 _executor = concurrent.futures.ProcessPoolExecutor
117 else:
118 raise ValueError("{} is not a valid executor type.".format(executor_type))
119 return _executor(max_workers=executor_max_workers)
120
121 def _prepare_fn(self, fn, force_copy=False):
122 if isinstance(self._self, concurrent.futures.ThreadPoolExecutor) \

Callers 1

init_appMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected