WeAreFarmGeek / diplomat

A HTTP Ruby API for Consul
BSD 3-Clause "New" or "Revised" License
370 stars 116 forks source link

Add blocking read support for service health endpoint #221

Closed jebentier closed 3 years ago

jebentier commented 3 years ago

Currently blocking read was added to Diplomat::Service.get, but not to Diplomat::Health.service. It would be nice to have the ability to utilize the blocking read functionality when getting health status for services as well.

pierresouchay commented 3 years ago

@jebentier Yes indeed, the abstraction are poor for waiting for changes, but as you found it, support has been added for Service::get. I would be glad to review it quickly and integrate it if you provide as PR.

Tell me if you need help

Regards

jebentier commented 3 years ago

@pierresouchay Thank you for taking the time to respond. I've gone ahead and opened #222 with the necessary changes to port this functionality over. Please let me know if there is anything else that I can do.

pierresouchay commented 3 years ago

@jebentier Thanks a lot for your contribution, very much appreciated!

I have merged it and created version 2.6.0, so you can use it easily.

FYI If you are watching a lot of Consul changes, you might also have a look at https://github.com/criteo/consul-templaterb which provides a much more hi-level API with many optimizations built-in (very efficient if you want to provide configuration files on changing environments as well)