Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RPCChannel

The channel used for the communication. Can support synchronous and/or asynchronous messages.

Note: if sync/async is not supported, make sure to use the correct return type for functions: FunctionReturnBehavior.

Hierarchy

  • RPCChannel

Index

Methods

  • receive(callback: (message: RPC_Message, replyChannel?: RPCChannel, context?: any) => void): void
  • Register a callback for when an async message arrives. Note: The "context" is exposed during function calls via the SuperRPC.currentContext property.

    Parameters

    • callback: (message: RPC_Message, replyChannel?: RPCChannel, context?: any) => void
        • (message: RPC_Message, replyChannel?: RPCChannel, context?: any): void
        • Parameters

          • message: RPC_Message
          • Optional replyChannel: RPCChannel
          • Optional context: any

          Returns void

    Returns void

  • sendAsync(message: RPC_Message): void
  • Sends a message asnychronously. The response will come via the receive callback function.

    Parameters

    • message: RPC_Message

    Returns void

  • sendSync(message: RPC_Message): any
  • Sends a message and returns the response synchronously.

    Parameters

    • message: RPC_Message

    Returns any

Generated using TypeDoc