Instead of having a static timeout, state.PollUntil or a similar function could interact with context to allow callers to control their own cancellation while permitting graceful cleanup of resources. e.g. if the user gets impatient and sends SIGINT during polling.
See this comment by @BlakeWilliams:
Minor, but this could be an interesting place to use context on the launchd client side, so we can send our own timeout/cancellation signals.