Publisher: opening a typed collection
AtCollection.registerFactory<HostNode>(HostNode.fromJson, typeTag: 'HostNode');
AtCollection.registerFactory<AtsignOnHost>(AtsignOnHost.fromJson, typeTag: 'AtsignOnHost');
AtCollection.registerFactory<StatSample>(StatSample.fromJson, typeTag: 'StatSample');
final nodes = await atClient.collection<HostNode>(
'nodes.dockerstats.demos',
const Duration(minutes: 10), // default TTL on every leaf
eventSource: EventSource.both,
);
- Factories pin the wire-format tag so it survives the Dart minifier and AOT obfuscation.
atClient.collection<T> caches one instance per namespace.
- The same factory registry is shared with every receiver that ever opens a sub-collection of these types.