Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • FacebookBatchQueue

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly queue

queue: QueueItem[]

The queue to store facebook requests.

Methods

flush

  • flush(): Promise<void>
  • Flushes the queue proactively.

    This queue has a timer to flush items at a time interval, so normally you don't need to call this method.

    example
    await bq.flush();
    

    Returns Promise<void>

push

  • Pushes a facebook request into the queue.

    example
    await bq.push({
    method: 'POST',
    relativeUrl: 'me/messages',
    body: {
    messagingType: 'UPDATE',
    recipient: 'PSID',
    message: { text: 'Hello World' },
    },
    });
    //=> {
    // recipientId: '...',
    // messageId: '...',
    // }

    Type parameters

    • T: JsonValue = any

    Parameters

    Returns Promise<T>

    A promise resolves the response of the request.

stop

  • stop(): void

Generated using TypeDoc