MCPcopy Create free account
hub / github.com/celery/celery / __init__

Method __init__

celery/worker/components.py:117–128  ·  view source on GitHub ↗
(self, w, autoscale=None, **kwargs)

Source from the content-addressed store, hash-verified

115 requires = (Hub,)
116
117 def __init__(self, w, autoscale=None, **kwargs):
118 w.pool = None
119 w.max_concurrency = None
120 w.min_concurrency = w.concurrency
121 self.optimization = w.optimization
122 if isinstance(autoscale, str):
123 max_c, _, min_c = autoscale.partition(',')
124 autoscale = [int(max_c), min_c and int(min_c) or 0]
125 w.autoscale = autoscale
126 if w.autoscale:
127 w.max_concurrency, w.min_concurrency = w.autoscale
128 super().__init__(w, **kwargs)
129
130 def close(self, w):
131 if w.pool:

Callers

nothing calls this directly

Calls 2

partitionMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected