MCPcopy
hub / github.com/psycopg/psycopg / enterabs

Method enterabs

psycopg_pool/psycopg_pool/sched_async.py:54–67  ·  view source on GitHub ↗

Enter a new task in the queue at an absolute time. Schedule a `!None` to stop the execution.

(self, time: float, action: Callable[[], Any] | None)

Source from the content-addressed store, hash-verified

52 return await self.enterabs(time, action)
53
54 async def enterabs(self, time: float, action: Callable[[], Any] | None) -> Task:
55 """Enter a new task in the queue at an absolute time.
56
57 Schedule a `!None` to stop the execution.
58 """
59 task = Task(time, action)
60 async with self._lock:
61 heappush(self._queue, task)
62 first = self._queue[0] is task
63
64 if first:
65 self._event.set()
66
67 return task
68
69 async def run(self) -> None:
70 """Execute the events scheduled."""

Callers 1

enterMethod · 0.95

Calls 2

TaskClass · 0.85
setMethod · 0.45

Tested by

no test coverage detected