swarpc - v0.10.0
    Preparing search index...

      swarpc - v0.10.0

      Documents

      README
      CHANGELOG

      Type Aliases

      SwarpcClient

      The sw&rpc client instance, which provides methods to call procedures. Each property of the procedures map will be a method, that accepts an input, an optional onProgress callback and an optional request ID. If you want to be able to cancel the request, you can set the request's ID yourself, and call .abort(requestId, reason) on the client instance to cancel it.

      RequestBoundLogger
      LogLevel
      SwarpcServer

      The sw&rpc server instance, which provides methods to register procedure implementations, and listens for incoming messages that call those procedures

      Procedure

      A procedure declaration

      CancelablePromise

      A promise that you can cancel by calling .cancel(reason) on it:

      ProcedureImplementation

      An implementation of a procedure

      ProceduresMap

      Declarations of procedures by name.

      An example of declaring procedures:

      ImplementationsMap

      Implementations of procedures by name

      Hooks

      Declaration of hooks to run on messages received from the server

      PayloadHeader
      PayloadCore
      Payload

      The effective payload as sent by the server to the client

      ClientMethod

      A procedure's corresponding method on the client instance -- used to call the procedure. If you want to be able to cancel the request, you can use the cancelable method instead of running the procedure directly.

      Variables

      LOG_LEVELS
      PayloadHeaderSchema
      PayloadCoreSchema
      PayloadSchema
      zImplementations

      Symbol used as the key for the procedures map on the server instance

      zProcedures

      Symbol used as the key for the procedures map on instances

      Functions

      Client
      postMessageSync

      A quicker version of postMessage that does not try to start the client listener, await the service worker, etc. esp. useful for abort logic that needs to not be... put behind everything else on the event loop.

      startClientListener

      Starts the client listener, which listens for messages from the sw&rpc server.

      makeRequestId

      Generate a random request ID, used to identify requests between client and server.

      Server

      Creates a sw&rpc server instance.