-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documents WorkerEvents #446
Conversation
EventEmitter
should be used, it might be useful to other to add these examples to the documentation. Tell me what you think of this PR 🙂 fix #385: Documents WorkerEventsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Since you can do this from the config now, it's no longer library-only; please move it to website/docs/worker-events.md
and make any necessary updates to the other files. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @benjie! I've addressed your comments
website/docs/worker-events.md
Outdated
/** | ||
* When a worker is created | ||
*/ | ||
"worker:fatalError": { worker: Worker; error: any; jobError: any | null }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I've noticed that this comment is probably wrong. Do you have a suggestion for a better documentation?
I had a look at the code, is it when the worker cannot be created? In that case, what would you think of this proposition?
/** | |
* When a worker is created | |
*/ | |
"worker:fatalError": { worker: Worker; error: any; jobError: any | null }; | |
/** | |
* When a worker cannot be created because of an unhandled error | |
*/ | |
"worker:fatalError": { worker: Worker; error: any; jobError: any | null }; |
@benjie did you had a chance to take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - thanks! 🙌
Live here: https://worker.graphile.org/docs/worker-events 🙌 |
That's great! Thanks @benjie! |
Description
I was having trouble understanding how worker events could be used inside the configuration file. The example provided in #385 helped me.
I figured that since we were at least two not understanding how
EventEmitter
should be used, it might be useful to other to add these examples to the documentation.Tell me what you think of this PR 🙂
Performance impact
None, documentation only
Security impact
None, documentation only
Checklist
yarn lint:fix
passes.yarn test
passes.RELEASE_NOTES.md
file (if one exists).