apologiesserver.periodic

Module Contents

apologiesserver.periodic.logger
class apologiesserver.periodic.Periodic(interval: float, coro: Callable[Ellipsis, Awaitable], *args, **kwargs)
property interval

return: Using interval.

property started

Current periodic state.

Returns:

True if periodic is started.

property running

Current task state.

Returns:

True if task is running.

property coro

return: Using coro.

property args

return: Using args.

property kwargs

return: Using kwargs.

async start(delay: float = None)

Starts periodic.

If delay is None(default) task will be called first time after selected interval, if 0, task will be called immediately, otherwise task will be called after delay seconds.

Parameters:

delay – Delay for the first run of task in seconds. Default is None.

Returns:

None

async stop(wait: float = 0)

Stops periodic. Wait or cancel task if it running.

If wait is 0(by default) task will be cancelled immediately. If False then stop will wait until task finished, otherwise stop will wait for present seconds and then cancel task.

Parameters:

wait – Seconds for waiting task for stop.

Returns:

None