Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Queue

Implements

Index

Constructors

constructor

Properties

batchSize

batchSize: number

deleteImmediately

deleteImmediately: boolean

fifo

fifo: boolean

handler

handler: QueueHandler

longPollingInterval

longPollingInterval: number

onFinish

onFinish: Function

queueName

queueName: string

queueUrl

queueUrl: string

sqs

sqs: SQS

visibilityTimeout

visibilityTimeout: number

Methods

create

  • create(): Promise<void>
  • This must be called immediately after instantiation. This is what actually creates the queue.

    Returns Promise<void>

delete

  • delete(): Promise<void>
  • Attempt to delete the queue. Note that this will throw if the queue has already been deleted or was never created in the first place.

    Returns Promise<void>

Private deleteMessages

  • deleteMessages(messages: Message[]): Promise<void>
  • Deletes an array of messages.

    Parameters

    • messages: Message[]

    Returns Promise<void>

Private encodeBatchOfMessages

  • encodeBatchOfMessages(messages: string[]): SendMessageBatchRequest
  • Takes an array of strings (messages) and returns a batch message request.

    Parameters

    • messages: string[]

    Returns SendMessageBatchRequest

Private extractMessageBody

  • extractMessageBody(rawMessage: Message): string
  • Parameters

    • rawMessage: Message

    Returns string

fill

  • fill(items: string | string[]): Promise<void>
  • Add item(s) to the queue. For the sake of simplicity, we'll accept either a string or array of strings which we'll then cast as an array and pass to SQS.sendMessageBatch.

    Parameters

    • items: string | string[]

    Returns Promise<void>

getQueueSize

  • getQueueSize(): Promise<number>
  • Fetches the current approximate count of visible items in the queue.

    Returns Promise<number>

Private getQueueStats

  • Fetches stats about the queue. For now this just grabs the current approximate visible message count as well as the queue's ARN.

    Returns Promise<QueueStats>

process

  • process(): Promise<void>

Private receiveMessages

  • receiveMessages(): any
  • Our private message long-polling method. Long-polls the queue for QueueConfig.longPollingInterval seconds at a time (up to a max of 20). We'll have this method call itself again at the end of the interval after checking to make sure that there are still items left in the queue.

    Returns any

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc