MCPcopy Index your code
hub / github.com/python/cpython / enterabs

Method enterabs

Lib/sched.py:62–76  ·  view source on GitHub ↗

Enter a new event in the queue at an absolute time. Returns an ID for the event which can be used to remove it, if necessary.

(self, time, priority, action, argument=(), kwargs=_sentinel)

Source from the content-addressed store, hash-verified

60 self._sequence_generator = count()
61
62 def enterabs(self, time, priority, action, argument=(), kwargs=_sentinel):
63 """Enter a new event in the queue at an absolute time.
64
65 Returns an ID for the event which can be used to remove it,
66 if necessary.
67
68 """
69 if kwargs is _sentinel:
70 kwargs = {}
71
72 with self._lock:
73 event = Event(time, priority, next(self._sequence_generator),
74 action, argument, kwargs)
75 heapq.heappush(self._queue, event)
76 return event # The ID
77
78 def enter(self, delay, priority, action, argument=(), kwargs=_sentinel):
79 """A variant that specifies the time as a relative time.

Callers 9

enterMethod · 0.95
test_enterabsMethod · 0.80
test_priorityMethod · 0.80
test_cancelMethod · 0.80
test_emptyMethod · 0.80
test_queueMethod · 0.80
test_args_kwargsMethod · 0.80

Calls 1

EventClass · 0.70

Tested by 8

test_enterabsMethod · 0.64
test_priorityMethod · 0.64
test_cancelMethod · 0.64
test_emptyMethod · 0.64
test_queueMethod · 0.64
test_args_kwargsMethod · 0.64