MCPcopy Create free account
hub / github.com/brmmm3/fastthreadpool / _submit_at

Method _submit_at

fastthreadpool/fastthreadpool.py:453–466  ·  view source on GitHub ↗
(self, _runat, interval, fn, done_callback, args, kwargs)

Source from the content-addressed store, hash-verified

451
452 #c cdef object _submit_at(self, _runat, interval, fn, done_callback, args, kwargs) except +:
453 def _submit_at(self, _runat, interval, fn, done_callback, args, kwargs): #p
454 if isinstance(_runat, struct_time):
455 _runat = mktime(_runat)
456 now = _time()
457 if _runat < now:
458 raise ValueError("_runat has invalid value!")
459 timer_obj = TimerObj()
460 # noinspection PyTypeChecker
461 timer = Timer(_runat - now, self._schedule_do, (timer_obj, _runat - interval, interval,
462 fn, done_callback, args, kwargs))
463 timer_obj.timer_id = timer
464 self._scheduled.append(timer)
465 timer.start()
466 return timer_obj
467
468 def submit_at(self, _runat, interval, fn, *args, **kwargs):
469 return self._submit_at(_runat, interval, fn, True, args, kwargs)

Callers 2

submit_atMethod · 0.95
submit_done_atMethod · 0.95

Calls 1

TimerObjClass · 0.85

Tested by

no test coverage detected