How to use the tomodachi.transport.schedule.Scheduler.decorator function in tomodachi

To help you get started, we’ve selected a few tomodachi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                cls.next_call_at(time.time(), interval, timestamp, cls.get_timezone(timezone))  # test provided interval/timestamp on init

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))
github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                cls.next_call_at(time.time(), interval, timestamp, cls.get_timezone(timezone))  # test provided interval/timestamp on init

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))
github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
async def _schedule() -> None:
            cls.close_waiter = asyncio.Future()

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                cls.next_call_at(time.time(), interval, timestamp, cls.get_timezone(timezone))  # test provided interval/timestamp on init

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))
github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))
github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
return None
        context['_schedule_loop_started'] = True

        async def _schedule() -> None:
            cls.close_waiter = asyncio.Future()

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                cls.next_call_at(time.time(), interval, timestamp, cls.get_timezone(timezone))  # test provided interval/timestamp on init

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))
github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
async def _schedule() -> None:
            cls.close_waiter = asyncio.Future()

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                cls.next_call_at(time.time(), interval, timestamp, cls.get_timezone(timezone))  # test provided interval/timestamp on init

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))
github kalaspuff / tomodachi / tomodachi / transport / schedule.py View on Github external
cls.next_call_at(time.time(), interval, timestamp, cls.get_timezone(timezone))  # test provided interval/timestamp on init

            for interval, timestamp, timezone, immediately, func, handler in context.get('_schedule_scheduled_functions', []):
                await cls.start_schedule_loop(cls, obj, context, handler, func, interval, timestamp, timezone, immediately)

        return _schedule


schedule = Scheduler.decorator(Scheduler.schedule_handler)

heartbeat = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))
every_second = Scheduler.decorator(Scheduler.schedule_handler_with_interval(1))

minutely = Scheduler.decorator(Scheduler.schedule_handler_with_interval('minutely'))
hourly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('hourly'))
daily = Scheduler.decorator(Scheduler.schedule_handler_with_interval('daily'))
monthly = Scheduler.decorator(Scheduler.schedule_handler_with_interval('monthly'))