AppleSauce
    Preparing search index...

    Variable presistEventsToCacheConst

    presistEventsToCache: (
        eventStore: IEventStoreStreams,
        write: (events: Event[]) => Promise<void>,
        opts?: { batchTime?: number; maxBatchSize?: number },
    ) => () => void = persistEventsToCache

    Type declaration

      • (
            eventStore: IEventStoreStreams,
            write: (events: Event[]) => Promise<void>,
            opts?: { batchTime?: number; maxBatchSize?: number },
        ): () => void
      • Setups a process to write batches of new events from an event store to a cache

        Parameters

        • eventStore: IEventStoreStreams

          The event store to read from

        • write: (events: Event[]) => Promise<void>

          The function to write the events to the cache

        • Optionalopts: { batchTime?: number; maxBatchSize?: number }

          The options for the process

          • OptionalbatchTime?: number

            The time to wait before writing a batch (default: 5 seconds)

          • OptionalmaxBatchSize?: number

            The maximum number of events to write in a batch

        Returns () => void

        A function to stop the process

    Use persistEventsToCache instead