Skip to main content
Version: 0.8.0

SequentialExecutor

fastkafka.executors.SequentialExecutor​

View source

A class that implements a sequential executor for processing consumer records.

The SequentialExecutor class extends the StreamExecutor class and provides functionality for running processing tasks in sequence by awaiting their coroutines.

init​

View source
__init__(
self, throw_exceptions=False, max_buffer_size=100000
)

Create an instance of SequentialExecutor

Parameters:

NameTypeDescriptionDefault
throw_exceptionsboolFlag indicating whether exceptions should be thrown or logged.Defaults to False.False
max_buffer_sizeintMaximum buffer size for the memory object stream.Defaults to 100_000.100000

run​

View source
run(
self, is_shutting_down_f, generator, processor
)

Runs the sequential executor.

Parameters:

NameTypeDescriptionDefault
is_shutting_down_fCallable[[], bool]Function to check if the executor is shutting down.required
generatorCallable[[], Awaitable[aiokafka.structs.ConsumerRecord]]Generator function for retrieving consumer records.required
processorCallable[[aiokafka.structs.ConsumerRecord], Awaitable[NoneType]]Processor function for processing consumer records.required