{"_id":"discovery","_rev":"11-58414ede7d7b3c675a44e15e64586499","name":"discovery","description":"Discovery provides dynamic service discovery over a pluggable interface.","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"discovery","version":"1.0.0","description":"Discovery provides dynamic service discovery over a pluggable interface.","main":"lib/index.js","scripts":{"test":"mocha --reporter spec test/discovery"},"repository":{"type":"git","url":"git://github.com/Schoonology/discovery.git"},"keywords":["discovery","distributed","supercluster","udp","multicast","tcp"],"author":{"name":"Michael Schoonmaker"},"license":"MIT, Copyright (c) 2013 Michael Schoonmaker","dependencies":{"debug":"~0.7.2","clone":"~0.1.10","sigmund":"~1.0.0","rc":"~0.3.1"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0","obcheckt":"~0.1.4"},"bugs":{"url":"https://github.com/Schoonology/discovery/issues"},"_id":"discovery@1.0.0","dist":{"shasum":"d736e54b0c7e286b329996ac9be75cbf25e82fe7","tarball":"https://registry.npmjs.org/discovery/-/discovery-1.0.0.tgz","integrity":"sha512-UPsOF9GVYW98ENIZlg68IdUCH35hI8vDQ9La/46/8lInWimIs5mHfYkJh1nMl79SZbDRNO2GmhnEjEwXzFnlag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGv7YnttjOgmUfnYVYY3ZtZU253MLouwpi+I+Tx5dSzQIgR6PTdSier/yHlOOiXZR3Eqrh4wZ8XjiEQGXXZ0rOFeQ="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"},"maintainers":[{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"}]},"1.0.1":{"name":"discovery","version":"1.0.1","description":"Discovery provides dynamic service discovery over a pluggable interface.","main":"lib/index.js","scripts":{"test":"mocha --reporter spec test/discovery"},"repository":{"type":"git","url":"git://github.com/Schoonology/discovery.git"},"keywords":["discovery","distributed","supercluster","udp","multicast","tcp"],"author":{"name":"Michael Schoonmaker"},"license":"MIT, Copyright (c) 2013 Michael Schoonmaker","dependencies":{"debug":"~0.7.2","clone":"~0.1.10","sigmund":"~1.0.0","rc":"~0.3.1","ip":"~0.1.0"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0","obcheckt":"~0.1.4"},"bugs":{"url":"https://github.com/Schoonology/discovery/issues"},"_id":"discovery@1.0.1","dist":{"shasum":"37b9e270a10625f86dc50291f6b9eb4aa99517d8","tarball":"https://registry.npmjs.org/discovery/-/discovery-1.0.1.tgz","integrity":"sha512-9Jbc5fJ1v9GwNeLiKoriZlZ/grc0GMalcvHFpedEyekXZsQb7yESGbLZOPROTAvQGaJxA84laSa0DctuG5sA2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqkgqBZiEN8ZunsSNHnsI5FpjQhvhNCwlEF2MqlJd6iQIhAO3dqmko34cvlt8OzMdqxzncUM9WhPnMna46Gn2XApmq"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"},"maintainers":[{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"}]},"1.1.0":{"name":"discovery","version":"1.1.0","description":"Discovery provides dynamic service discovery over a pluggable interface.","main":"lib/index.js","scripts":{"test":"mocha --reporter spec test/discovery"},"repository":{"type":"git","url":"git://github.com/Schoonology/discovery.git"},"keywords":["discovery","distributed","supercluster","udp","multicast","tcp"],"author":{"name":"Michael Schoonmaker"},"license":"MIT, Copyright (c) 2013 Michael Schoonmaker","dependencies":{"clone":"~0.1.10","debug":"~0.7.2","ip":"~0.1.0","rc":"~0.3.1","sigmund":"~1.0.0","optimist":"~0.6.1"},"devDependencies":{"mocha":"~1.13.0","chai":"~1.8.0","obcheckt":"~0.1.4"},"optionalDependencies":{"optimist":"~0.6.1"},"gitHead":"9d123d74c13f8c9b6904e409f8933b09ab22e175","bugs":{"url":"https://github.com/Schoonology/discovery/issues"},"homepage":"https://github.com/Schoonology/discovery","_id":"discovery@1.1.0","_shasum":"1a39470be8928a67c118ce65894cb6c009802fe3","_from":".","_npmVersion":"2.1.8","_nodeVersion":"0.10.33","_npmUser":{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"},"maintainers":[{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"}],"dist":{"shasum":"1a39470be8928a67c118ce65894cb6c009802fe3","tarball":"https://registry.npmjs.org/discovery/-/discovery-1.1.0.tgz","integrity":"sha512-iJ/2PTt/m+WnAVUQYJt55uJ58kHQwuWNB+UeLbAcoC25UqZ1S5+x6XkwmCaL6tNN/tNmukvHdL2HlodUYGcwOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpAersobagHUKzeXeH6trswElEXdEUN/ryXFR2VZJcsAIhANvpPpT3a7RPI7zGtaKzI+YtloLKkIHCtwQLnNHztf1J"}]}}},"readme":"# Discovery\n\nDiscovery provides dynamic service discovery over a pluggable interface.\n\n## Design\n\nThe Registry is the cornerstone of Discovery. Each node in the cluster is\nexpected to have at least one Registry, with that Registry being responsible\nfor one or more local Services. Its Manager, in turn, synchronizes the\nRegistry's understanding of the cluster and its remotely-available Services.\n\n### Services\n\nDiscovery makes few assumptions about the format or purpose of Service objects.\nAll Services must be given a `name`, and will be assigned a universally-unique\n`id` to identify instances of a Service that share the same name. The Service\ninterface provides a consistent interface for managing the metadata associated\nwith ths service it represents and the announcements thereof.\n\n### Registry\n\nEach Registry is, in essence, a list of Service objects associated with a\nManager to synchronize them across machines. Additionally, the Registry makes an\ninternal distinction between \"local\" Services (those in the same process), and\n\"remote\" Services (those on other processes, even if they're on the same\nmachine).\n\n### Managers\n\nManagers seek to broadcast the presence of a Registry's local Services while\nreceiving broadcasts about the Services contained in other Registries. The\nManager interface abstracts both the algorithm and transport(s) used for this\nsynchronization; new transports and algorithms can be plugged into Discovery\nthrough the implementation of a new Manager and the assignment of that\nManager as the `manager` option/property of all Registries within the system.\n\n## API\n\n### Registry `new discovery.Registry(options)` Alias: `discovery.createRegistry`\n\nCreates a new instance of Registry with the provided `options`.\n\nThe Registry is the cornerstone of Discovery. Each node in the cluster\nis expected to have at least one Registry, with that Registry being responsible\nfor one or more local Services. Its Manager, in turn, synchronizes the\nRegistry's understanding of the cluster and its remotely-available Services.\n\n#### destroy `registry.destroy()`\n\nSignals a graceful shutdown of the Registry's and its Manager's internal\nresources.\n\n#### createService `registry.createService(name, [data], [available])`\n\nCreates a new, local Service object to represent the named service. This\nService will be synchronized via the Manager to all other Registry objects\nin its network. That is, all other Registry objects whose Managers are both\ncompatible and reachable by this Registry's Manager will emit 'available'\nevents for this Service.\n\n#### Event: `\"available\"`\n\nThe Registry emits an `\"available\"` event for every Service that comes\navailable, whether they be local or remote. Two arguments are passed in to the\nevent handler: the `name` of the Service and the `data` currently associated\nwith that Service.\n\nIf you need a unique identifier for this Service \"instance\", use `id`, as\n`name` is preserved from the original `createService` call, and may not be\nunique.\n\n#### Event: `\"unavailable\"`\n\nThe Registry emits an `\"unavailable\"` event for every Service that comes\nunavailable _after being available at some point in the past_. The arguments\npassed in to `\"unavailable\"` mirror those of `\"available\"`: `name` and `data.\n\nNo guarantees are made beyond the order of events: available, unavailable,\navailable, unavailable, ... - two events may arrive in the same tick, the\nManagers involved may elect to consider your Service(s) \"unavailable\" for\nimplementation-specific reasons, and so forth. Design and plan accordingly.\n\n### Service\n\n#### update `service.update(data)`\n\nMerges `data` with the Service's existing `data` property. Returns `true` if\nthe update was required (i.e. something was different), `false` otherwise\n(e.g. `data` remains unchanged).\n\n#### toJSON `service.toJSON()`\n\nReturns a JSON representation of the Service, omitting process-local\ndetails that are inappropriate within other processes, e.g. `local`.\n\n### Manager `new discovery.Manager(options)` Alias: `discovery.createManager`\n\nCreates a new instance of Manager with the provided `options`.\n\nThis class provides the abstract interface for more specific Manager\nimplementations.\n\nSee UdpBroadcastManager for a specific example.\n\n#### destroy `manager.destroy()`\n\nSignals a graceful shutdown of the Manager's internal resources.\n\n#### generateId `manager.generateId()`\n\nReturns a Manager-specific unique identifier.\n\nSee Registry.generateId for more information.\n\n#### addLocalService `manager.addLocalService(service)`\n\nUsed as a signal from the Registry to its Manager that a new local Service\nis available.\n\n#### removeLocalService `manager.removeLocalService(service)`\n\nUsed as a signal from the Registry to its Manager that a local Service\nis no longer available.\n\n#### updateLocalService `manager.updateLocalService(service)`\n\nUsed as a signal from the Registry to its Manager that a local Service\nhas updated its data without updating its availability.\n\n#### toJSON `manager.toJSON()`\n\nReturns a JSON representation of the Manager suitable for logging debug\ninformation.\n\n### UdpBroadcastManager `discovery.UdpBroadcast(options)`\n\nCreates a new instance of UdpBroadcastManager with the provided `options`.\n\nThe UdpBroadcastManager provides a client connection to the\nzero-configuration, UDP-based discovery system that is used by Discovery\nby default. Because it requires zero configuration to use, it's ideal for\ninitial exploration and development. However, it's not expected to work\nat-scale, and should be replaced with the included HTTP-based version.\n\n#### destroy `udpBroadcastManager.destroy()`\n\nSignals a graceful shutdown of the UdpBroadcastManager.\n\n#### generateId `udpBroadcastManager.generateId()`\n\nReturns a UDP-specific unique identifier using the machine's IP address\nand the configured port number.\n\nSee Manager.generateId for more information.\n\n### HttpManager `discovery.Http(options)`\n\nCreates a new instance of HttpManager with the provided `options`.\n\nThe HttpManager provides a client connection to the HTTP-based, Tracker\ndiscovery system.\n\n#### destroy `httpManager.destroy()`\n\nSignals a graceful shutdown of the HttpManager.\n\n#### generateId `httpManager.generateId()`\n\nReturns an HTTP-specific unique identifier using the machine's IP address\nand the configured port number.\n\nSee Manager.generateId for more information.\n","maintainers":[{"name":"schoonology","email":"michael.r.schoonmaker@gmail.com"}],"time":{"modified":"2022-06-15T05:00:20.886Z","created":"2013-11-05T17:03:07.961Z","1.0.0":"2013-11-05T17:03:09.431Z","1.0.1":"2013-11-05T17:09:07.649Z","1.1.0":"2015-03-14T01:20:18.131Z"},"author":{"name":"Michael Schoonmaker"},"repository":{"type":"git","url":"git://github.com/Schoonology/discovery.git"},"homepage":"https://github.com/Schoonology/discovery","keywords":["discovery","distributed","supercluster","udp","multicast","tcp"],"bugs":{"url":"https://github.com/Schoonology/discovery/issues"},"license":"MIT, Copyright (c) 2013 Michael Schoonmaker","readmeFilename":"README.md","users":{"goliatone":true,"tmurngon":true}}