Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

added input/status checks, testcases, and comments for road-to-v1 #2243

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

sio4
Copy link
Member

@sio4 sio4 commented Apr 18, 2022

Improved the simple worker:

  • Added input/status checks for
    • Register(), if the name and handler are defined correctly
    • Perform() and PerformIn(), if the worker's context was already canceled to prevent job submission
  • Added wait group count for delayed jobs (PerformIn)
  • Added locking in Stop() to prevent job submission when stopping
  • Added comments for the road-to-v1 (refine/improve the design of worker and simple worker implementation #2242)

(This PR was started for #2241)

@sio4 sio4 added the enhancement New feature or request label Apr 18, 2022
@sio4 sio4 self-assigned this Apr 18, 2022
@sio4 sio4 requested a review from a team as a code owner April 18, 2022 13:49
@sio4 sio4 marked this pull request as draft April 18, 2022 13:49
@sio4
Copy link
Member Author

sio4 commented Apr 21, 2022

This PR was started for #2241 but the root cause of the issue was not here. However, this PR will make Simple Worker more reliable.

@sio4 sio4 marked this pull request as ready for review April 21, 2022 14:44
@paganotoni
Copy link
Member

Thanks for this one @sio4

@sio4
Copy link
Member Author

sio4 commented Apr 21, 2022

Thanks!

@fasmat
Copy link
Member

fasmat commented Apr 21, 2022

Thanks @sio4, looks good to me!

@paganotoni paganotoni merged commit 11507d3 into gobuffalo:development Apr 21, 2022
@sio4 sio4 deleted the 2241-panic-in-simpleworker branch April 21, 2022 15:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants