MCPcopy Index your code
hub / github.com/RustPython/RustPython / call_later

Method call_later

Lib/asyncio/base_events.py:775–797  ·  view source on GitHub ↗

Arrange for a callback to be called at a given time. Return a Handle: an opaque object with a cancel() method that can be used to cancel the call. The delay can be an int or float, expressed in seconds. It is always relative to the current time. Each callb

(self, delay, callback, *args, context=None)

Source from the content-addressed store, hash-verified

773 return time.monotonic()
774
775 def call_later(self, delay, callback, *args, context=None):
776 """Arrange for a callback to be called at a given time.
777
778 Return a Handle: an opaque object with a cancel() method that
779 can be used to cancel the call.
780
781 The delay can be an int or float, expressed in seconds. It is
782 always relative to the current time.
783
784 Each callback will be called exactly once. If two callbacks
785 are scheduled for exactly the same time, it is undefined which
786 will be called first.
787
788 Any positional arguments after the callback will be passed to
789 the callback when it is called.
790 """
791 if delay is None:
792 raise TypeError('delay must not be None')
793 timer = self.call_at(self.time() + delay, callback, *args,
794 context=context)
795 if timer._source_traceback:
796 del timer._source_traceback[-1]
797 return timer
798
799 def call_at(self, when, callback, *args, context=None):
800 """Like call_later(), but uses an absolute time.

Callers

nothing calls this directly

Calls 2

call_atMethod · 0.95
timeMethod · 0.95

Tested by

no test coverage detected