make the state file an optional feature; fix some comments #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The state file is great for tasks where you plan on coming back later to verify the state of the job. However, if you want to have a handler for a fire-and-forget event it becomes a bit troublesome. If you don't reap the state file, subsequent events will silently fail. Because it is a fire-and-forget event, the failures are then widespread and silent.
I didn't see any assertions against the state file itself, so let me know if there's anything you'd like me to enhance there.
Lastly, fixed some typos in some of the comments.
To note: beyond a compilation check,
ruby -c
, this hasn't been thoroughly tested. I don't have an environment locally to do so, just yet.