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)
| 1150 | |
| 1151 | |
| 1152 | def 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) |
no test coverage detected