Table Of Contents

Previous topic

Calendar

Next topic

CheckBox

This Page

phoenix_title CallLater

A convenience class for Timer, that calls the given callable object once after the given amount of milliseconds, passing any positional or keyword args. The return value of the callable is availbale after it has been run with the GetResult method.

If you don’t need to get the return value or restart the timer then there is no need to hold a reference to this object. It will hold a reference to itself while the timer is running (the timer has a reference to Notify) but the cycle will be broken when the timer completes, automatically cleaning up the CallLater object.

See also

CallAfter


class_hierarchy Inheritance Diagram

Inheritance diagram for class CallLater

Inheritance diagram of CallLater


method_summary Methods Summary

__init__ A convenience class for Timer, that calls the given callable
GetInterval  
GetResult Returns the value of the callable.
HasRun Returns whether or not the callable has run.
IsRunning  
Notify The timer has expired so call the callable.
SetArgs (Re)set the args passed to the callable object. This is
Start (Re)start the timer
Stop Stop and destroy the timer.
__del__  

property_summary Properties Summary

Interval See GetInterval
Result See GetResult

api Class API



class CallLater(object)

A convenience class for Timer, that calls the given callable object once after the given amount of milliseconds, passing any positional or keyword args. The return value of the callable is availbale after it has been run with the GetResult method.

If you don’t need to get the return value or restart the timer then there is no need to hold a reference to this object. It will hold a reference to itself while the timer is running (the timer has a reference to Notify) but the cycle will be broken when the timer completes, automatically cleaning up the CallLater object.

See also

CallAfter


Methods



__init__(self, millis, callableObj, *args, **kwargs)

A convenience class for Timer, that calls the given callable object once after the given amount of milliseconds, passing any positional or keyword args. The return value of the callable is availbale after it has been run with the GetResult method.

Parameters:
  • millis (int) – number of milli seconds
  • callableObj (PyObject) – the callable object
  • args – arguments to be passed to the callable object
  • kw – keywords to be passed to the callable object


GetInterval(self)


GetResult(self)

Returns the value of the callable.

Return type:a Python object
Returns:result from callable


HasRun(self)

Returns whether or not the callable has run.

Return type:bool


IsRunning(self)


Notify(self)

The timer has expired so call the callable.



SetArgs(self, *args, **kwargs)

(Re)set the args passed to the callable object. This is useful in conjunction with Restart if you want to schedule a new call to the same callable object but with different parameters.

Parameters:
  • args – arguments to be passed to the callable object
  • kw – keywords to be passed to the callable object


Start(self, millis=None, *args, **kwargs)

(Re)start the timer

Parameters:
  • millis (int) – number of milli seconds
  • args – arguments to be passed to the callable object
  • kw – keywords to be passed to the callable object


Stop(self)

Stop and destroy the timer.



__del__(self)

Properties



Interval

See GetInterval



Result

See GetResult