StoreNodeGateway constructor
StoreNodeGateway({
- required OmnyStoreHub store,
- NodeAdmissionPolicy? admissionPolicy,
- int chunkBytes = StoreProtocol.defaultChunkBytes,
- Logger logger = const NoopLogger(),
- String mount = '/_node',
- String name = 'omnystore-nodes',
- Duration heartbeatInterval = const Duration(seconds: 10),
- Duration heartbeatTimeout = const Duration(seconds: 30),
Creates a gateway feeding store.
Implementation
StoreNodeGateway({
required this.store,
this.admissionPolicy,
this.chunkBytes = StoreProtocol.defaultChunkBytes,
this.logger = const NoopLogger(),
String mount = '/_node',
String name = 'omnystore-nodes',
Duration heartbeatInterval = const Duration(seconds: 10),
Duration heartbeatTimeout = const Duration(seconds: 30),
}) {
service = NodeGateway(
name: name,
mount: mount,
heartbeatInterval: heartbeatInterval,
heartbeatTimeout: heartbeatTimeout,
logger: logger,
onRegister: _onRegister,
onHeartbeat: _onHeartbeat,
onNotify: _onNotify,
onDisconnect: _onDisconnect,
onTimeout: _onTimeout,
// A node that drops is removed from the registry outright rather than
// retained as offline: the hub is not the system of record for a node's
// catalogue, and keeping a dead provider in the routing table would make
// every lookup pay a failing round-trip.
retainNodes: false,
);
}