(self, schedule: "Job", also_run_immediately=False)
return wrapper
Call a coroutine on the specified schedule

        Schedule a task using the `schedule` library:

            import lightbus
            import schedule

            bus = lightbus.create()

            # Run the task every 1-3 seconds, varying randomly
            @bus.client.schedule(schedule.every(1).to(3).seconds)
            def do_it():
                print("Hello using schedule library")

        This can also be used to decorate async functions. In this case the function will be awaited.

        See Also:

            @bus.client.every()
Call a coroutine on the specified schedule
Call a coroutine on the specified schedule
def schedule(self, schedule: "Job", also_run_immediately=False):
        """Call a coroutine on the specified schedule

        Schedule a task using the `schedule` library:

            import lightbus
            import schedule

            bus = lightbus.create()

            # Run the task every 1-3 seconds, varying randomly
            @bus.client.schedule(schedule.every(1).to(3).seconds)
            def do_it():
                print("Hello using schedule library")

        This can also be used to decorate async functions. In this case the function will be awaited.

        See Also:

            @bus.client.every()
        """

        def wrapper(f):
            coroutine = call_on_schedule(
                callback=f, schedule=schedule, also_run_immediately=also_run_immediately
            )
            self.add_background_task(coroutine)
            return f

        return wrapper
def schedule ( self , schedule : "Job" , also_run_immediately = False ) : def wrapper ( f ) : coroutine = call_on_schedule ( callback = f , schedule = schedule , also_run_immediately = also_run_immediately ) self . add_background_task ( coroutine ) return f return wrapper