-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow getting connection pools for an event loop in clients #109
Comments
@wfltaylor Do you have a concrete example use case of what you’re trying to do in which the current API doesn’t allow? Most of the API surface exposes limited access for a reason - either abstraction from a specific database engine, or to limit the chance of having bad state. |
I am trying to extend |
To do what exactly? To have access to Redis for executing commands as part of the job’s process? This might be more of a feature request for Queues more specifically |
Yes exactly - I need to be able to read and write to Redis during the execution of the job. |
@wfltaylor you should be able to get to it from |
Is this safe, as this instance isn't for the jobs event loop? |
@wfltaylor good point, in that case I guess it depends on whether or not you are running the queue in a single event loop. If not then yeah that probably isn't safe. |
That's possible, so do you know of any way to get Redis with the correct event loop? This is done by the Redis library for requests, but I haven't been able to figure out a way to do this without using inaccessible methods. |
Nope I would agree with you @wfltaylor, the |
I moved this here as it makes sense to me that a job should be given the underlying driver client for the provided event loop as part of the context |
Is your feature request related to a problem? Please describe.
It would be useful to be able to get the
RedisConnectionPool
for anEventLoop
. For example, one may want to extendQueueContext
with a Redis property, to allow using Redis from Vapor Jobs.Describe the solution you'd like
The method
pool(eventLoop:)
inApplication.Redis
could be made public.Describe alternatives you've considered
This library could extend each type that could make use of Redis.
The text was updated successfully, but these errors were encountered: