Ticket #2634 (closed enhancement: fixed )

Opened 2 years ago

Last modified 2 years ago

IReactorTime is missing method to determine the current time

Reported by: exarkun Assigned to: radix
Type: enhancement Priority: normal
Milestone: Component: core
Keywords: Cc:
Branch: Author:
Launchpad Bug:

Description

With only a method to schedule a call, code which wants to test time-related functionality has to cobble together an IReactorTimer provider with some other object which can report the current time. Likewise, implementations have no uniform way to allow their scheduling code to be completely overridden, since it is common for scheduling code needs to know the current time (and this code currently uses twisted.python.runtime.seconds if it is correct, or time.time if it is incorrect).

Attachments

Change History

  2007-05-10 19:22:30+00:00 changed by radix

See #2633 for a branch that should resolve this ticket.

  2007-05-14 00:38:31+00:00 changed by radix

  • status changed from new to closed
  • resolution set to fixed

(In [20273]) Merge parameterize-looping-call-2633.

Author: radix Reviewer: therve Fixes #2633 Fixes #2634

LoopingCall? (and code which uses it) is now much more testable because the scheduler it uses is overridable. In support of this, a 'seconds' method was added to the reactor (IReactorTime) to strengthen the logical grouping of 'what is the current scheduling-time' and 'schedule a call for later'.

Note: See TracTickets for help on using tickets.