I prefetch iterations from an iterator, providing a getNext method suitable for Deferator.

You can supply an ID for me, purely to provide a more informative representation and something you can retrieve via my ID attribute.

Method __init__ Undocumented
Method __repr__ An informative representation. You may thank me for having this during development.
Method isBusy
Method setup Sets me up with an attempt at an initial prefetch.
Method getNext Prefetch analog to __next__ on a regular iterator.
Method _tryNext Returns a deferred that fires with the value from my nextCallTuple along with a bool indicating if it's a valid value.
def __init__(self, ID=None):
Undocumented
def __repr__(self):

An informative representation. You may thank me for having this during development.

def isBusy(self):
ReturnsTrue if I've been set up with a call to setup and am still running whatever iteration that involved.
def _tryNext(self):

Returns a deferred that fires with the value from my nextCallTuple along with a bool indicating if it's a valid value.

Deletes the nextValue reference after it returns with a failure.

def setup(self, *args, **kw):

Sets me up with an attempt at an initial prefetch.

Set me up with a new iterator, or the callable for an iterator-like-object, along with any args or keywords. Does a first prefetch.

ReturnsA Deferred that fires with True if all goes well or False otherwise.
def getNext(self):

Prefetch analog to __next__ on a regular iterator.

Gets the next value from my current iterator, or a deferred value from my current nextCallTuple, returning it along with a Bool indicating if this is a valid value and another one indicating if more values are left.

Once a prefetch returns a bogus value, the result of this call will remain (None, False, False), until a new iterator or nextCallable is set.

Use this method as the callable (second constructor argument) of Deferator.

API Documentation for AsynQueue, generated by pydoctor at 2022-11-17 13:13:24.