HubMessagingRepository constructor

HubMessagingRepository({
  1. required Uri url,
  2. required HubTransport transport,
  3. HubIdentity? identity,
  4. String? name,
  5. String? token,
  6. Duration backoff(
    1. int attempt
    ) = defaultHubBackoff,
  7. void onLog(
    1. String message
    )?,
})

Builds a repository for the hub at url. identity defaults to a fresh one — hosts that need a stable address persist the seeds and pass them back (see lib/io.dart). token is the pairing token for a protected hub (rides the upgrade as ?dap_token=, the browser-safe form). onLog receives soft diagnostics (decrypt failures, protocol errors) — never required.

Implementation

HubMessagingRepository({
  required Uri url,
  // ignore: prefer_initializing_formals
  required HubTransport transport,
  HubIdentity? identity,
  this.name,
  this.token,
  this.backoff = defaultHubBackoff,
  this.onLog,
}) : _dialUrl = url,
     // ignore: prefer_initializing_formals
     _transport = transport,
     _identityFuture = identity == null
         ? HubIdentity.generate()
         : Future.value(identity);