.. include:: headings.inc .. _CallLater: ========================================================================================================================================== |phoenix_title| **CallLater** ========================================================================================================================================== A convenience class for :class:`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 :meth:`~CallLater.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 :meth:`~CallLater.Notify`) but the cycle will be broken when the timer completes, automatically cleaning up the :class:`CallLater` object. .. seealso:: :func:`CallAfter` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **CallLater** .. raw:: html

Inheritance diagram of CallLater

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~CallLater.__init__` A convenience class for :class:`Timer`, that calls the given callable :meth:`~CallLater.GetInterval` :meth:`~CallLater.GetResult` Returns the value of the callable. :meth:`~CallLater.HasRun` Returns whether or not the callable has run. :meth:`~CallLater.IsRunning` :meth:`~CallLater.Notify` The timer has expired so call the callable. :meth:`~CallLater.SetArgs` (Re)set the args passed to the callable object. This is :meth:`~CallLater.Start` (Re)start the timer :meth:`~CallLater.Stop` Stop and destroy the timer. :meth:`~CallLater.__del__` ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~CallLater.Interval` See :meth:`~CallLater.GetInterval` :attr:`~CallLater.Result` See :meth:`~CallLater.GetResult` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: CallLater(object) A convenience class for :class:`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 :meth:`~CallLater.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 :meth:`~CallLater.Notify`) but the cycle will be broken when the timer completes, automatically cleaning up the :class:`CallLater` object. .. seealso:: :func:`CallAfter` .. method:: __init__(self, millis, callableObj, *args, **kwargs) A convenience class for :class:`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 :meth:`~CallLater.GetResult` method. :param int millis: number of milli seconds :param PyObject callableObj: the callable object :param args: arguments to be passed to the callable object :param kw: keywords to be passed to the callable object .. method:: GetInterval(self) .. method:: GetResult(self) Returns the value of the callable. :rtype: a Python object :return: result from callable .. method:: HasRun(self) Returns whether or not the callable has run. :rtype: bool .. method:: IsRunning(self) .. method:: Notify(self) The timer has expired so call the callable. .. method:: SetArgs(self, *args, **kwargs) (Re)set the args passed to the callable object. This is useful in conjunction with :meth:`Restart` if you want to schedule a new call to the same callable object but with different parameters. :param args: arguments to be passed to the callable object :param kw: keywords to be passed to the callable object .. method:: Start(self, millis=None, *args, **kwargs) (Re)start the timer :param int millis: number of milli seconds :param args: arguments to be passed to the callable object :param kw: keywords to be passed to the callable object .. method:: Stop(self) Stop and destroy the timer. .. method:: __del__(self) .. attribute:: Interval See :meth:`~CallLater.GetInterval` .. attribute:: Result See :meth:`~CallLater.GetResult`