Home

Awesome

ssb-conn-staging

Module that manages potential and optional peer connections. For use with the SSB CONN family of modules.

Visual metaphor: a bench with substitute players, idle and not actively in the game, optionally available and waiting for further instructions to join or not.

staging.png

Usage

This module is only used to create an SSB CONN plugin, not used directly by applications. A ConnStaging instance should be available on the CONN plugin, with the following API:

Types

All staging entries are key-value pairs returned as an array, with the following shape:

type StagingEntry = [Address, Data]

// where...
type Address = string;
type Data = {
  key?: string;
  type?: 'bt' | 'lan' | 'internet';
  stagingBirth: number; // timestamp
  stagingUpdated: number; // timestamp
  [misc: string]: any;
}

In other words, it is an array where the first element is the multiserver address for a staged peer, and the second element is an object that has some fields, e.g. key, type, stagingBirth, stagingUpdated, etc.

API

License

MIT