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)
| 725 | |
| 726 | |
| 727 | def EmbeddedService(app, max_interval=None, **kwargs): |
| 728 | """Return embedded clock service. |
| 729 | |
| 730 | Arguments: |
| 731 | thread (bool): Run threaded instead of as a separate process. |
| 732 | Uses :mod:`multiprocessing` by default, if available. |
| 733 | """ |
| 734 | if kwargs.pop('thread', False) or _Process is None: |
| 735 | # Need short max interval to be able to stop thread |
| 736 | # in reasonable time. |
| 737 | return _Threaded(app, max_interval=1, **kwargs) |
| 738 | return _Process(app, max_interval=max_interval, **kwargs) |