hseeberger / constructr

Coordinated (etcd, ...) cluster construction for dynamic (cloud, containers) environments
Apache License 2.0
212 stars 37 forks source link

Add close() method to Coordination for resource cleanup #167

Open franbh opened 6 years ago

franbh commented 6 years ago

Hi, because of Tecsisa/constructr-consul#49, I think it is necessary to add a close() method to Coordination, in order to perform resource release on system shutdown in a clean, elegant way. An example of such resource cleanup would be destroying the Consul session instead of just relying on TTL.

close() would be invoked by the ConstructrMachine implementation of the onTermination hook.

If this is not useful to etcd, we can just have a dummy implementation of close(), returning something like Future.successful(Done).