pub fn task<A, B, Envelope, EE, IH, SP>(
    offset_store: (impl Future<Output = Result<()>>, Sender<Command>),
    source_provider: SP,
    handler: IH
) -> (impl Future<Output = Result<()>>, Sender<()>)where
    A: Handler<Envelope = EE> + Send,
    B: PendingHandler<Envelope = EE> + Send,
    EE: TryFrom<Envelope>,
    Envelope: WithPersistenceId + WithOffset + WithSeqNr + WithSource + Send,
    IH: Into<Handlers<A, B>>,
    SP: SourceProvider<Envelope = Envelope>,
Expand description

Provides an asynchronous task and a kill switch that can run and stop a projection.

An at-least-once projection is returned with storage for projection offsets, meaning, for multiple runs of a projection, it is possible for events to repeat from previous runs.