Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PublishStore

This is the interface for classes that represents a publish store. The AMPS client uses publish stores for recovery purposes. The store is responsible for maintaining the state of published messages and recovering that state in the event of a disconnection. Optionally, the store may persist message state and recover that state if the application restarts. (Node.js only)

Hierarchy

  • PublishStore

Implemented by

Index

Methods

discardUpTo

  • This method discards all operations up to the index provided.

    Parameters

    • sequenceId: BigInteger

      The sequence id to keep. All previous sequence numbers will be discarded.

    Returns void

lastPersisted

  • This method returns the last persisted sequence id in the store.

    Returns BigInteger

    The sequence number of the last discarded message.

lowestUnpersisted

  • This method returns the oldest sequence in the store.

    Returns BigInteger

    The oldest sequence number in the store.

replay

  • replay(messageSender: function): void
  • This method replays all messages in the store using the provided message sender.

    Parameters

    • messageSender: function

      The sender that will re-send the messages.

        • (header: Header, data?: any, timeout?: number): void
        • Parameters

          • header: Header
          • Optional data: any
          • Optional timeout: number

          Returns void

    Returns void

replaySingle

  • replaySingle(messageSender: function, sequenceId: BigInteger): void
  • This method replays the message with the specified sequenceId.

    Parameters

    • messageSender: function
        • (header: Header, data?: any, timeout?: number): void
        • Parameters

          • header: Header
          • Optional data: any
          • Optional timeout: number

          Returns void

    • sequenceId: BigInteger

      The sequence id of the message to replay.

    Returns void

store

  • This method stores the provided message. The sequence of the message is a key that the client can later use to replay the operation or remove the operation from the store. Implementations may assume that the sequence increases monotonically.

    Parameters

    Returns void

unpersistedCount

  • unpersistedCount(): number
  • This method returns the number of messages in the store.

    Returns number

    The number of messages in the store.