Ticket #2633 (closed enhancement: fixed )

Opened 2 years ago

Last modified 2 years ago

LoopingCall should parameterize its scheduler

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

Description

_callLater and _seconds should both be provided or obsoleted by parameterized functions or a Clock/reactor-like object.

Attachments

Change History

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

  • keywords set to review
  • owner deleted

Up for review at parameterize-loopingcall-scheduler-2633, which also attempts to resolve #2634.

  2007-05-12 19:53:02+00:00 changed by therve

  • cc set to therve
  • keywords deleted
  • owner set to radix
  • priority changed from normal to highest
  • I don't really like the setClock method. I mean, anybody can do loop.clock = foo, right?
  • the variable new_time in t.i.base should be named newTime
  • the docstring of seconds in t.i.interfaces should be
    """
    blah.
    """
    
    Don't hesitate to clean the docstrings of IReactorTime :)
  • the test_seconds is a bit insane, but I guess you have a reason for that

Apart from nitpicking, that looks really great, so please merge when you're ok.

  2007-05-12 19:58:51+00:00 changed by therve

One last thing: can you update the copyright notices of the touched files? Thanks.

  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.