OffsetIterator<T > class
Properties
buffer
→ Queue <T >
The buffer contains items that have yet to be pulled.
The process
function can return a chunk of multiple items, but because
pull
only returns one item at a time, the extra items are buffered.
final
cancelOnError
→ bool
If true
, cancel will be called on error.
final
drained
→ bool
Returns true
if all the data has been pulled.
no setter
earliestAvailableOffset
↔ int
The earliest offset that still has a value
getter/setter pair
hashCode
→ int
The hash code for this object.
no setter inherited
log
→ Queue <Option <T > >
The log contains previously pulled items. Retention is controlled by the
rentention
property.
final
name
→ String
final
offset
→ int
The current head offset.
no setter
retention
→ int
How many items to retain in the log.
If set to a negative number (e.g. -1), it will retain everything.
Defaults to 0 (retains nothing).
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
state
↔ OffsetIteratorState <T >
The latest state from the process
function.
getter/setter pair
status
→ OffsetIteratorStatus
The internal status
no setter
value
→ Option <T >
Get the current head value as an option.
no setter
valueOrNull
→ T?
Get the current head value, or null
.
no setter
Static Methods
combine <T > (Iterable <OffsetIterator <T > > iterators , {String name = 'OffsetIterator.combine' , bool closeOnError = true , SeedCallback <T > ? seed })
→ OffsetIterator <T >
Combine multiple OffsetIterator 's into one.
fromFuture <T > (Future <T > future (), {String name = 'OffsetIterator.fromFuture' , SeedCallback <T > ? seed })
→ OffsetIterator <T >
fromIterable <T > (Iterable <T > iterable , {String name = 'OffsetIterator.fromIterable' , int retention = 0 , SeedCallback <T > ? seed })
→ OffsetIterator <T >
Create an OffsetIterator
from the provided Iterable
.
fromStream <T > (Stream <T > stream , {int retention = 0 , SeedCallback <T > ? seed , String name = 'OffsetIterator.fromStream' , bool cancelOnError = true })
→ OffsetIterator <T >
Create an OffsetIterator
from the provided Stream
.
If a ValueStream
with a seed is given, it will populate the iterator's
seed value.
fromStreamEither <T > (Stream <T > stream , {int retention = 0 , SeedCallback <Either<dynamic , T > > ? seed , String name = 'OffsetIterator.fromStreamEither' })
→ OffsetIterator <Either<dynamic , T > >
Create an OffsetIterator
from the provided Stream
.
If a ValueStream
with a seed is given, it will populate the iterator's
seed value.
fromValue <T > (T value , {String name = 'OffsetIterator.fromValue' , SeedCallback <T > ? seed })
→ OffsetIterator <T >
range (int start , {int ? end , String name = 'OffsetIterator.range' , int retention = 0 , SeedCallback <int > ? seed })
→ OffsetIterator <int >
offset_iterator_riverpod 0.0.24