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

Function EmbeddedService

celery/beat.py:1152–1166  ·  view source on GitHub ↗

Return embedded clock service. Arguments: thread (bool): Run threaded instead of as a separate process. Uses :mod:`multiprocessing` by default, if available.

(app, max_interval=None, **kwargs)

Source from the content-addressed store, hash-verified

1150
1151
1152def EmbeddedService(app, max_interval=None, **kwargs):
1153 """Return embedded clock service.
1154
1155 Arguments:
1156 thread (bool): Run threaded instead of as a separate process.
1157 Uses :mod:`multiprocessing` by default, if available.
1158 """
1159 # Off by default: the surrounding worker already has a
1160 # remote-control node answering for this process.
1161 kwargs.setdefault('remote_control', False)
1162 if kwargs.pop('thread', False) or _Process is None:
1163 # Need short max interval to be able to stop thread
1164 # in reasonable time.
1165 return _Threaded(app, max_interval=1, **kwargs)
1166 return _Process(app, max_interval=max_interval, **kwargs)

Callers 1

createMethod · 0.90

Calls 4

_ThreadedClass · 0.85
_ProcessClass · 0.85
setdefaultMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected