Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • NIMChatroomQueueInterface

Implemented by

Index

Methods

  • peak(_options: { done: any }): void
  • Get the first element of the queue. The return data is the third parameter of the callback

    Parameters

    • _options: { done: any }
      • done:function
        • done(err: null | Error, param: object, obj: { elementKey: string; elementValue: string }): void
        • Parameters

          • err: null | Error
          • param: object
          • obj: { elementKey: string; elementValue: string }
            • elementKey: string

              UniqKey of an element, up to 128 bytes.

            • elementValue: string

              Content of an element, up to 4096 bytes

          Returns void

    Returns void

  • queueChange(_options: { elementMap: {}; needNotify?: boolean; notifyExt?: string; done?: any }): void
  • Update multiple elements in a queue. If needNotify is set to true, all online users will receive the following notification. If needNotify is set to false, no users receive updates

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'BATCH_UPDATE'
    • attach.custom is notifyExt

    Parameters

    • _options: { elementMap: {}; needNotify?: boolean; notifyExt?: string; done?: any }
      • elementMap: {}

        Update multiple key-value pairs of elements. The key and value are represented with elementKey and elementValue. elementKey can contain up to 128 bytes, and elementValue 4096 bytes. A maximum of 100 key-value pairs can be updated at a time.

        • [key: string]: string
      • Optional needNotify?: boolean

        Whether a broadcast message is required for updates, optional. Default value: false If the value is set to true, notifyExt is also required.

      • Optional notifyExt?: string

        Custom field in the notification. 2048 characters are allowed

      • done?:function
        • done(err: null | Error, data: NIMStrAnyObj, Obj: { elementKeyArray: string[] }): void
        • callback for the result

          Parameters

          • err: null | Error
          • data: NIMStrAnyObj
          • Obj: { elementKeyArray: string[] }
            • elementKeyArray: string[]

          Returns void

    Returns void

  • queueDrop(_options: { done: any }): void
  • Clear a queue. Only regular members of the chat room have permission to clear the queue. After the queue is cleared, all online users will receive the following notification:

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'DROP'

    Parameters

    Returns void

  • queueList(_options: { done: any }): void
  • Get the queue of a chat room queue

    Parameters

    • _options: { done: any }
      • done:function
        • done(err: null | NIMCommonError | Error | NIMStrAnyObj, data: { queueList: { elementKey: string; elementValue: string }[] }): void
        • Parameters

          • err: null | NIMCommonError | Error | NIMStrAnyObj
          • data: { queueList: { elementKey: string; elementValue: string }[] }
            • queueList: { elementKey: string; elementValue: string }[]

          Returns void

    Returns void

  • queueOffer(_options: { elementAccount?: string; elementKey: string; elementValue: string; transient?: boolean; done?: any }): void
  • Add or update new elements in the queue. If elementKey already exists, update the element, otherwise insert a new element at the end of the queue. After the operation, all online users will receive the following notification message:

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'OFFER'

    Parameters

    • _options: { elementAccount?: string; elementKey: string; elementValue: string; transient?: boolean; done?: any }
      • Optional elementAccount?: string

        Optional, account to which an element belongs. By default, no argument is taken and the element belongs to the current user. Administrators can assign specified elements to other valid accounts.

      • elementKey: string

        UniqKey of a new element, up to 128 bytes

      • elementValue: string

        Content of a new element, up to 4096 bytes

      • Optional transient?: boolean

        Optional parameter, default value: false. Whether the element is deleted when when the user who submitted this new element is disconnected from the chat room or leaves the chat room.

      • done?:function

    Returns void

  • queuePoll(_options: { elementKey?: string; done: any }): void
  • Delete an element in the queue. After the operation, all online users will receive the following notification message:

    • attach.type === 'updateQueue'
    • attach.queueChange.type === 'POLL'

    Parameters

    • _options: { elementKey?: string; done: any }
      • Optional elementKey?: string

        The UniqKey of the element to be taken. If unspecified, the first element is taken.

      • done:function
        • done(err: null | Error, data: { elementKey?: string }, obj: { elementKey: string; elementValue: string }): void
        • callback for the result

          Parameters

          • err: null | Error
          • data: { elementKey?: string }
            • Optional elementKey?: string
          • obj: { elementKey: string; elementValue: string }
            • elementKey: string

              UniqKey of an element, up to 128 bytes.

            • elementValue: string

              Content of an element, up to 4096 bytes

          Returns void

    Returns void