txaio._common
=============

.. py:module:: txaio._common


Classes
-------

.. autoapisummary::

   txaio._common._BatchedCall
   txaio._common._BatchedTimer


Module Contents
---------------

.. py:class:: _BatchedCall(timer, index, the_call)

   Bases: :py:obj:`object`


   Wraps IDelayedCall-implementing objects, implementing only the API
   which txaio promised in the first place: .cancel

   Do not create these yourself; use _BatchedTimer.call_later()


   .. py:method:: __call__()


   .. py:attribute:: _call


   .. py:attribute:: _index


   .. py:attribute:: _timer


   .. py:method:: cancel()


.. py:class:: _BatchedTimer(bucket_milliseconds, chunk_size, seconds_provider, delayed_call_creator, loop=None)

   Bases: :py:obj:`txaio.interfaces.IBatchedTimer`


   Internal helper.

   Instances of this are returned from
   :meth:`txaio.make_batched_timer` and that is the only way they
   should be instantiated. You may depend on methods from the
   interface class only (:class:`txaio.IBatchedTimer`)

   **NOTE** that the times are in milliseconds in this class!


   .. py:attribute:: _bucket_milliseconds


   .. py:attribute:: _buckets


   .. py:attribute:: _chunk_size


   .. py:attribute:: _create_delayed_call


   .. py:attribute:: _get_seconds


   .. py:attribute:: _loop
      :value: None



   .. py:method:: _notify_bucket(real_time)

      Internal helper. This 'does' the callbacks in a particular bucket.

      :param real_time: the bucket to do callbacks on



   .. py:method:: _remove_call(real_time, call)

      Internal helper. Removes a (possibly still pending) call from a
      bucket. It is *not* an error of the bucket is gone (e.g. the
      call has already happened).



   .. py:method:: call_later(delay, func, *args, **kwargs)

      IBatchedTimer API



