Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface StreamedInContext<Request, Response>

Context for an action command that handles streamed messages in.

Type Parameters

  • Request extends object = any

    The type of the request message

  • Response extends object = any

    The type of the response message

Hierarchy

Index

Properties

cancelled: boolean

Whether the client is still connected.

metadata: Metadata

The metadata associated with the command.

Methods

  • write(message: Response, metadata?: Metadata): void
  • cancel(): void
  • on(eventType: "data", callback: ((message: Request) => void)): void
  • on(eventType: "end", callback: (() => void | Reply<Response>)): void
  • DEPRECATED. Emit an effect after processing this command.

    deprecated

    Use Reply.addEffect instead.

    Parameters

    • method: EffectMethod

      The entity service method to invoke

    • message: Message

      The message to send to that service

    • Optional synchronous: boolean

      Whether the effect should be execute synchronously or not

    • Optional metadata: Metadata

      Metadata to send with the effect

    • Optional internalCall: boolean

      For internal calls to this deprecated function

    Returns void

  • Fail handling this command.

    remarks

    An alternative to using this is to return a failed Reply created with replies.failure.

    throws

    An error that captures the failure message. Note that even if you catch the error thrown by this method, the command will still be failed with the given message.

    Parameters

    • msg: string

      The failure message

    • Optional grpcStatus: GrpcStatus

      The grpcStatus

    Returns void

  • DEPRECATED. Forward this command to another service component call.

    deprecated

    Use replies.forward instead.

    Parameters

    • method: EffectMethod

      The service component method to invoke

    • message: Message

      The message to send to that service component

    • Optional metadata: Metadata

      Metadata to send with the forward

    • Optional internalCall: boolean

      For internal calls to this deprecated function

    Returns void

Generated using TypeDoc