@scalecube/scalecube-discovery
TypeScript icon, indicating that this package has built-in type declarations

0.2.11 • Public • Published

Join the chat at https://gitter.im/scalecube-js/Lobby

This is part of scalecube-js project, see more at https://github.com/scalecube/scalecube-js
Full documentation

Discovery

This package provides a default discovery implementation. it is intended to publish and discover any data in a distributed environment.

Basic Usage

import { createDiscovery } from '@scalecube/scalecube-discovery';

const discoveryConfig = {
  seedAddress,
  address,
  itemsToPublish: [],
};

const discovery = createDiscovery(discoveryConfig);

// on subscribe to `discoveredItems$()`, we will start getting emits of the distributed environment's latest state.
discovery.discoveredItems$().subscribe(console.log); 


// on calling `destroy()`, we will remove our metadata from the distributed environment. 
// also, it stops the discovery from sharing/publishing metadata.
discovery.destroy().then(console.log); 

Readme

Keywords

none

Package Sidebar

Install

npm i @scalecube/scalecube-discovery

Weekly Downloads

14

Version

0.2.11

License

MIT

Unpacked Size

25.3 kB

Total Files

13

Last publish

Collaborators

  • ronen.nachmias
  • idanilt
  • scalecube-ci
  • skolomiiets
  • scalecube-js-user-developer
  • idokatz
  • viktor.pyshnenko