-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Extend the API with opaque runs #208
Conversation
Btw, codecov hasn't been getting coverage for a while, as a token is not configured. I don't have access to the codecov org to get one, nor to the GHA secrets here to add one such token, so I need somebody with access to it to fix it 🙏🏽 https://github.com/inaka/worker_pool/actions/runs/10970849472/job/30465212510?pr=208
|
I'm… not super convinced about this, @NelsonVides … can you provide an example of a worker that needs this new approach? |
I have two use cases I'm dealing with currently, one is the The other use case I have very often is... supervisors! Supervisors are also gen_servers under the hood, and often I want to have a pool of supervisors, to load-balance spawning children for example, as otherwise a single supervisor would be a bottleneck (see ranch dealing with this some years ago ninenines/ranch#110), so again, you don't Another solution would be to have a |
I see what you're saying… now… do you mind showing here how you plan to use this new functionality with supervisors, for instance. Maybe even adding that example to the library documentation somehow? |
Sometimes a library exposes a very complex API but uses a gen_server under the hood, and we want to pool this gen_server, but we're not supposed to explicitly do `gen_server:call/3` nor `gen_server:cast/2`, but use the API instead. To enable this, we expose the possibility to run a function callback with a worker once a worker has been found.
354de85
to
0ef6a31
Compare
Done, added both as an example in the documentation as well as a test :) |
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.
Now I get it!! Thanks, @NelsonVides :)
Just a few considerations/adjustments.
Co-authored-by: Brujo Benavides <[email protected]>
Btw @elbrujohalcon ☝🏽 |
Yeah… I saw the codecov thing, @NelsonVides… but I don't have that much spare time this days… Do you mind turning that into an issue I can fix later? Thanks. |
@NelsonVides should I bake a release right now… or are there other pending things that should be included in it? |
#210 created :) |
I want to come back to the queue manager as I mentioned, but in the following weeks I'm having a bunch of holidays planned so I can't promise to do it very soon, though I'll try in between. So maybe a release already? Hex packages are easy to push new ones anyway :) |
Done! https://hex.pm/packages/worker_pool/6.4.0 |
Done, you're now allowed to publish this project to hex.pm, @NelsonVides |
Done, documentation pushed for both the previous 6.3.0 as well as for this 6.4.0 😁 |
Sometimes a library exposes a very complex API but uses a gen_server
under the hood, and we want to pool this gen_server, but we're not
supposed to explicitly do
gen_server:call/3
norgen_server:cast/2
,but use the API instead. To enable this, we expose the possibility to
run a function callback with a worker once a worker has been found.