Pulse v0.1.3 Pulse.Discover
Start one or more Pulse.Discover
workers to look up registered nodes for required services.
The module taks 3 parameters in a keyword list, for legibility:
service
- A binary indicating the service name to discover.poll
- An integer indicating the number of seconds to wait between discovery refreshes.delay
- An integer indicating the number of seconds to wait before first discovery.
children = [
worker(Pulse.Discover, [[service: "my_service", poll: 5, delay: 1]])
]
Each Pulse.Discover
worker is only responsible for one service, but you can discover multiple services by declaring more than one worker.
children = [
worker(Pulse.Discover, [[service: "my_service", poll: 5, delay: 1]], id: MyApp.MyServiceDiscover),
worker(Pulse.Discover, [[service: "my_other_service", poll: 5, delay: 1]], id: MyApp.MyOtherServiceDiscover)
# ...
]
The configuration options should be tuned for your application, however the values shown above are a good baseline.