Interface ProtocolService

class: ProtocolService

  • support inter communication (sync or async) between micro-services.

Hierarchy

  • ProtocolService

Methods

  • get protocol-transformer by name

    Type Parameters

    • TEventParam = any

    • TLambdaEvent = TEventParam

    Parameters

    • name: "web" | "sns" | "sqs"

      name as 'web', 'sns', 'sqs'

    Returns ProtocolTransformer<TEventParam, TLambdaEvent>

  • broadcast body message via shared SNS subscriptions. (see NotificationHandler)

    • .service will be self url like api://lemon-hello-api#1.2.3

    Returns

    the message-id if applicable.

    Parameters

    • context: NextContext<NextIdentity<any>>

      the current execute context. (.identity will be relayed).

    • endpoint: string

      the SNS endpoint like lemon-hello-out, or full ARN.

    • body: ProtocolBody

      the message body to broadcast.

    Returns Promise<string>

  • asynchronous call to target function via 'SQS' (queue).

    Parameters

    • param: ProtocolParam<ProtocolBody, ProtocolBody>

      the calling param

    • Optional callback: CallbackParam

      the return target

    • Optional delaySeconds: number

      (from AWS doc) The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies. When you set FifoQueue, you can't set DelaySeconds per message. You can set this parameter only on a queue level.

    Returns Promise<string>

  • get the current service's protocol uri

    Parameters

    • context: NextContext<NextIdentity<any>>

      the current context.

    • Optional type: string

      (optional) resource type

    • Optional id: string

      (optional) resource id

    • Optional cmd: string

      (optional) action command

    Returns string

Generated using TypeDoc