Hermes MySQL
    Preparing search index...

    Function changedStreamsQuery

    • The query that finds the streams with events that a consumer has not processed yet, and that it can claim now: not claimed by another instance (or the claim expired), and not waiting for the retry of a failed event.

      It reads the rows of the consumer in hermes_subscriptions in the order of the primary key, from after on, and joins every stream by its primary key, so it needs no sort, and its cost grows with the number of streams that the consumer knows. The caller moves after past the streams it got and wraps around at the end, so busy streams at the beginning of the key order do not starve the others.

      Parameters

      • params: { after?: string; consumerName: string; limit: number; owner?: string }
        • Optionalafter?: string

          Only the streams after this one, in the order of their ids

        • consumerName: string

          The consumer

        • limit: number

          The maximum number of streams

        • Optionalowner?: string

          The instance that claims; the streams it already claims are included

      Returns { params: unknown[]; text: string }