Options
All
  • Public
  • Public/Protected
  • All
Menu

Framework @swim/mesh

@swim/mesh

package documentation chat

@swim/mesh implements a multiplexed streaming WARP client that runs in both Node.js and web browsers. @swim/mesh can be used in concert with the @swim/ui user interface toolkits to build massively real-time streaming applications. @swim/mesh is part of the broader @swim/system framework.

Framework

The @swim/mesh umbrella package depends on, and re-exports, the following component libraries:

  • @swim/warp (npm, doc) – WebSocket protocol for dynamically multiplexing large numbers of bidirectional links to streaming API endpoints, called lanes, of URI-addressed distributed objects, called nodes, that run stateful distributed processes, called Web Agents.
  • @swim/client (npm, doc) – streaming API client for linking to lanes of stateful Web Agents using the WARP protocol, enabling massively real-time applications that continuously synchronize all shared states with ping latency.

@swim/mesh builds on the @swim/core framework; it has no additional dependencies when run in a web browser, and depends only on a WebSocket implementation when run in Node.js.

Installation

npm

For an npm-managed project, npm install @swim/mesh to make it a dependency. TypeScript sources will be installed into node_modules/@swim/mesh/main. Transpiled JavaScript and TypeScript definition files install into node_modules/@swim/mesh/lib/main. And a pre-built UMD script, which bundles all @swim/mesh component libraries, can be found in node_modules/@swim/mesh/dist/main/swim-mesh.js.

Browser

Browser applications can load swim-mesh.js, along with its swim-core.js dependency, from the SwimOS CDN.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-mesh.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-mesh.min.js"></script>

Alternatively, the standalone swim-system.js script may be loaded from the SwimOS CDN, which bundles @swim/mesh together with all other @swim/system frameworks.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>

Usage

ES6/TypeScript

@swim/mesh can be imported as an ES6 module from TypeScript and other ES6-compatible environments. All component libraries are re-exported by the umbrella @swim/mesh module.

import * as swim from "@swim/mesh";

CommonJS/Node.js

@swim/mesh can also be used as a CommonJS module in Node.js applications. All component libraries are re-exported by the umbrella @swim/mesh module.

var swim = require("@swim/mesh");

Browser

When loaded by a web browser, the swim-mesh.js script adds all component library exports to the global swim namespace. The swim-mesh.js script requires that swim-core.js has already been loaded.

The swim-system.js script also adds all @swim/mesh component library exports to the global swim namespace, making it a drop-in replacement for swim-mesh.js when additional @swim/system frameworks are needed.

Index

References

AuthRequest

Re-exports AuthRequest

AuthedResponse

Re-exports AuthedResponse

BaseRef

Re-exports BaseRef

CommandMessage

Re-exports CommandMessage

DeauthRequest

Re-exports DeauthRequest

DeauthedResponse

Re-exports DeauthedResponse

Downlink

Re-exports Downlink

DownlinkContext

Re-exports DownlinkContext

DownlinkFlags

Re-exports DownlinkFlags

DownlinkInit

Re-exports DownlinkInit

DownlinkModel

Re-exports DownlinkModel

DownlinkObserver

Re-exports DownlinkObserver

DownlinkOwner

Re-exports DownlinkOwner

DownlinkRecord

Re-exports DownlinkRecord

DownlinkReifier

Re-exports DownlinkReifier

DownlinkStreamlet

Re-exports DownlinkStreamlet

DownlinkType

Re-exports DownlinkType

Envelope

Re-exports Envelope

EventDownlink

Re-exports EventDownlink

EventDownlinkInit

Re-exports EventDownlinkInit

EventDownlinkModel

Re-exports EventDownlinkModel

EventDownlinkObserver

Re-exports EventDownlinkObserver

EventMessage

Re-exports EventMessage

Host

Re-exports Host

HostAddressed

Re-exports HostAddressed

HostAddressedConstructor

Re-exports HostAddressedConstructor

HostContext

Re-exports HostContext

HostDownlink

Re-exports HostDownlink

HostOptions

Re-exports HostOptions

HostRef

Re-exports HostRef

LaneAddressed

Re-exports LaneAddressed

LaneAddressedConstructor

Re-exports LaneAddressedConstructor

LaneRef

Re-exports LaneRef

LinkAddressed

Re-exports LinkAddressed

LinkAddressedConstructor

Re-exports LinkAddressedConstructor

LinkRequest

Re-exports LinkRequest

LinkedResponse

Re-exports LinkedResponse

ListDownlink

Re-exports ListDownlink

ListDownlinkInit

Re-exports ListDownlinkInit

ListDownlinkModel

Re-exports ListDownlinkModel

ListDownlinkObserver

Re-exports ListDownlinkObserver

ListDownlinkRecord

Re-exports ListDownlinkRecord

MapDownlink

Re-exports MapDownlink

MapDownlinkInit

Re-exports MapDownlinkInit

MapDownlinkModel

Re-exports MapDownlinkModel

MapDownlinkObserver

Re-exports MapDownlinkObserver

MapDownlinkRecord

Re-exports MapDownlinkRecord

NodeRef

Re-exports NodeRef

RefContext

Re-exports RefContext

RemoteHost

Re-exports RemoteHost

SyncRequest

Re-exports SyncRequest

SyncedResponse

Re-exports SyncedResponse

UnlinkRequest

Re-exports UnlinkRequest

UnlinkedResponse

Re-exports UnlinkedResponse

ValueDownlink

Re-exports ValueDownlink

ValueDownlinkInit

Re-exports ValueDownlinkInit

ValueDownlinkModel

Re-exports ValueDownlinkModel

ValueDownlinkObserver

Re-exports ValueDownlinkObserver

ValueDownlinkRecord

Re-exports ValueDownlinkRecord

WarpClient

Re-exports WarpClient

WarpClientOptions

Re-exports WarpClientOptions

WarpObserver

Re-exports WarpObserver

WarpRef

Re-exports WarpRef

WebSocketConstructor

Re-exports WebSocketConstructor

WebSocketHost

Re-exports WebSocketHost

WebSocketHostOptions

Re-exports WebSocketHostOptions

authenticate

Re-exports authenticate

client

Re-exports client

command

Re-exports command

downlink

Re-exports downlink

downlinkList

Re-exports downlinkList

downlinkMap

Re-exports downlinkMap

downlinkValue

Re-exports downlinkValue

hostRef

Re-exports hostRef

isOnline

Re-exports isOnline

keepOnline

Re-exports keepOnline

laneRef

Re-exports laneRef

nodeRef

Re-exports nodeRef

Generated using TypeDoc