Hermes MongoDB
    Preparing search index...

    Type Alias Stop

    Stop: () => Promise<void>

    Function type that stops the outbox consumer gracefully.

    When called, this function:

    1. Closes the Change Stream
    2. Waits for in-flight events to complete
    3. Cleans up resources

    Type Declaration

      • (): Promise<void>
      • Returns Promise<void>

        Promise that resolves when consumer has fully stopped

    Manual shutdown

    const stop = await outbox.start()

    // Later...
    await stop()
    console.log('Consumer stopped gracefully')

    Shutdown with timeout

    const stop = await outbox.start()

    process.on('SIGTERM', async () => {
    console.log('Shutting down...')

    const timeout = setTimeout(() => {
    console.error('Shutdown timeout, forcing exit')
    process.exit(1)
    }, 5000)

    await stop()
    clearTimeout(timeout)
    console.log('Shutdown complete')
    })

    Start - The function that returns this stop function