HubMessagingRepository constructor
HubMessagingRepository({
- required Uri url,
- required HubTransport transport,
- HubIdentity? identity,
- String? name,
- String? token,
- Duration backoff(
- int attempt
- void onLog(
- 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);