MCPcopy
hub / github.com/celery/celery / create

Method create

celery/worker/components.py:226–246  ·  view source on GitHub ↗
(self, w)

Source from the content-addressed store, hash-verified

224 last = True
225
226 def create(self, w):
227 if w.max_concurrency:
228 prefetch_count = max(w.max_concurrency, 1) * w.prefetch_multiplier
229 else:
230 prefetch_count = w.concurrency * w.prefetch_multiplier
231 c = w.consumer = self.instantiate(
232 w.consumer_cls, w.process_task,
233 hostname=w.hostname,
234 task_events=w.task_events,
235 init_callback=w.ready_callback,
236 initial_prefetch_count=prefetch_count,
237 pool=w.pool,
238 timer=w.timer,
239 app=w.app,
240 controller=w,
241 hub=w.hub,
242 worker_options=w.options,
243 disable_rate_limits=w.disable_rate_limits,
244 prefetch_multiplier=w.prefetch_multiplier,
245 )
246 return c

Callers

nothing calls this directly

Calls 1

instantiateMethod · 0.80

Tested by

no test coverage detected