-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Feature: Add an API for giving workers more helpers #113
Comments
Is there a reason to not simply |
No, that seems like a good solution. I can try that out. Thanks! |
[semi-automated message] Thanks for your question; hopefully we're well on the way to helping you solve your issue. This doesn't currently seem to be a bug in the library so I'm going to close the issue, but please feel free to keep requesting help below and if it does turn out to be a bug we can definitely re-open it 👍 You can also ask for help in the #help-and-support channel in our Discord chat. |
@benjie The TODO is still there and I believe that in certain situations this would allow for much more pleasurable DX. For example in our case we have set up nodemailer instance for fastify route plugin consumption. All setup and "service" init is defined in Not the end of the world, don't get me wrong, Graphile Worker is an amazing alternative to |
Usecase
Give users of graphile-worker the ability to pass in custom helpers. This could include custom database connection objects, metadata, application-specific helpers, etc...
For example:
My specific usecase is to pass a Slonik database connection object.
Implementation
worker/src/helpers.ts
Line 71 in 1d4fa8c
It looks like if this TODO was done, this usecase could be satisified.
I'm not sure what the ultimate implementation would look like. Would there be a specific file like
helpers.ts
that would be loaded and named exports would automatically be included?Pitfalls/Things to watch out for
The text was updated successfully, but these errors were encountered: