Event used to emit when a service is available.
Debugger that can be used to output debug messages for the discovery.
Event used to emit when a service is no longer available.
Event used to emit when a service has been updated.
Get all the available services.
array with all services
Merge this discovery with another instance that provides compatible
services. Services will be merged using their id
.
Destroy this discovery. This should be called whenever the discovery is no longer needed. Destroying a discovery will ensure that no more events are triggered and that resources used by the discovery are released.
Filter the services discovered. This creates a new instance in which only services that pass the predicate function are available.
The filtered discovery is only valid as long as this discovery is not
destroyed. Calling destroy()
on this discovery will destroy the
filtered discovery.
Find the first service that match the given predicate. Will return
the service or undefined
.
Find all of the services that match the given predicate. Will return an array with all of the matching services.
Get a service based on an identifier.
instance of service or null
Log and emit an error for this discovery.
Map services returned by this discovery into another type of service.
The mapped discovery is only valid as long as this discovery is not
destroyed. Calling destroy()
on this discovery will destroy the
mapped discovery.
Remove a service that is no longer available.
previous service or null
if not registered
Set the services that should be available.
Add or update a service that has been found. This will register the service and emit suitable events. Services are identified internally using their identifier. Services will be treated as new if their id does is not currently tracked, and as updates if their id is currently tracked.
previous service or null
if not registered
Generated using TypeDoc
Basic discovery intended for extension. This type of discovery provides functions to update, remove and set services available.