Trait nakadion::HandlerFactory [] [src]

pub trait HandlerFactory {
    type Handler: BatchHandler + Send + 'static;
    fn create_handler(
        &self,
        partition: &PartitionId
    ) -> Result<Self::Handler, CreateHandlerError>; }

A factory that creates BatchHandlers.

Usage

A HandlerFactory can be used in two ways:

  • It does not contain any state it shares with the created BatchHandlers. This is useful when incoming data is partitioned in a way that all BatchHandlers act only on data that never appears on another partition.

  • It contains state that is shared with the BatchHandlers. E.g. a cache that conatins data that can appear on other partitions.

Associated Types

Required Methods

Implementors