StoreNodeGateway constructor

StoreNodeGateway({
  1. required OmnyStoreHub store,
  2. NodeAdmissionPolicy? admissionPolicy,
  3. int chunkBytes = StoreProtocol.defaultChunkBytes,
  4. Logger logger = const NoopLogger(),
  5. String mount = '/_node',
  6. String name = 'omnystore-nodes',
  7. Duration heartbeatInterval = const Duration(seconds: 10),
  8. 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,
  );
}