Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MemoryPublishStore

MemoryPublishStore represents the default implementation of the in-memory 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.

Hierarchy

  • MemoryPublishStore

Implements

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

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

      The sender that will re-send the message.

        • (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

  • Store 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

    • message: Message

      The message that contains fields like command name, topic name, data, etc.

    Returns void

unpersistedCount

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

    Returns number

    The number of messages in the store.