Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AwaitConfig

Hierarchy

  • AwaitConfig

Index

Properties

errorMessage

errorMessage: string

Custom error message to pass to the errorType function as the message, preferably about what kind of response to what input variables was awaited (e.g. channel name)

errorType

errorType: (message?: undefined | string, cause?: Error) => Error

Function to create custom error type given optional message and cause error.

param

Optional message

param

Optional cause

Type declaration

    • (message?: undefined | string, cause?: Error): Error
    • Parameters

      • Optional message: undefined | string
      • Optional cause: Error

      Returns Error

Optional failure

failure: Condition

If this condition evaluates to true on any incoming message, the promise is rejected with an error specifying the cause message.

Optional noResponseAction

noResponseAction: "success" | "failure"

Action to take after

  • a timeout occurs or
  • a response awaited later than this response is resolved or rejected (and given that since the server processes commands and sends their responses strictly sequentially) this response would never be fulfilled because the server is done processing this command
E.g. the client issues <code>JOIN #a,#b,#c</code> to the server,
and receives the responses for <code>a</code> and <code>c</code>,
in that order. In that case, the response for <code>b</code> can be
rejected the moment the response for <code>c</code> is received.

Optional success

success: Condition

If this condition evaluates to true on any incoming message, the promise is resolved with the message that matched.

Optional timeout

timeout: undefined | number

If neither the success or failure condition match on any message within this period (after connection, noResponseAction is taken.

Generated using TypeDoc