daemon: Adds SdNotifyBarrier
This adds daemon.SdNotifyBarrier including a unit test. It is modeled after systemd's sd_notify_barrier.
The barrier function is useful when a signalling process wants to wait for systemd to process previously-sent messages.
- I certify that I recognize and agree to the Developer Certificate of Origin of this project.
- Tested on go 1.15.2-linux-amd64 and 1.15.2-linux-386
-
go fmthas been applied to the source code as that seems to be the case with other source files in this project.
Thanks for a useful package!
It appears an unrelated, unmodified test failed from timeout according to Travis:
...
--- FAIL: TestPropertiesSubscription (10.01s)
1721 subscription_test.go:188: Reached timeout
...
@rsms thanks for the patch and the accompanying test! I've left a few comments in review, the only major one about using a context for timing out. The CI sometimes flakes a bit, in which case you can force-push to re-trigger it.
@rsms can you please rebase on latest master? CI moved to github actions in the meanwhile.