txaio._common

Classes

_BatchedCall

Wraps IDelayedCall-implementing objects, implementing only the API

_BatchedTimer

Internal helper.

Module Contents

class _BatchedCall(timer, index, the_call)[source]

Bases: 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()

__call__()[source]
_call[source]
_index[source]
_timer[source]
cancel()[source]
class _BatchedTimer(bucket_milliseconds, chunk_size, seconds_provider, delayed_call_creator, loop=None)[source]

Bases: txaio.interfaces.IBatchedTimer

Internal helper.

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

NOTE that the times are in milliseconds in this class!

_bucket_milliseconds[source]
_buckets[source]
_chunk_size[source]
_create_delayed_call[source]
_get_seconds[source]
_loop = None[source]
_notify_bucket(real_time)[source]

Internal helper. This ‘does’ the callbacks in a particular bucket.

Parameters:

real_time – the bucket to do callbacks on

_remove_call(real_time, call)[source]

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).

call_later(delay, func, *args, **kwargs)[source]

IBatchedTimer API