Skip to content
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

Local Pool (manager) with Remote Workers + Configurable Worker collection #133

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

matyasmarkovics
Copy link

@matyasmarkovics matyasmarkovics commented Aug 20, 2019

This PR should really be 2 as the title suggest. However, it was easier for me the to create it as single one. - Apologies! - I just wanted to get your thoughts on the changes first and find out whether you see these extensions useful. - I'm happy to take this further, e.g.: split the PR, etc.

Remote Workers

I use poolboy at work and needed to create a pool of processes similar to the rpc module implementation in Erlang/OTP. - rpc (or rex) is a single process, I needed a pool of them. - This led me to extend poolboy, so that (local) workers could be started by a supervisor on a remote node.

Worker Collection

In situations, where the worker is non-blocking, the pool performs better if the checkout, checkin mechanism is not used. However, it's still a good idea to distribute the work-load between workers, e.g.: simply relying on random distribution. - This led me to consider random-access data-structures, like array and tuple for the collection of workers. - I've added a module: poolboy_collection that encapsulates the data-structure, in which the workers are stored.

@Vagabond
Copy link
Collaborator

Vagabond commented Aug 4, 2020

There's a lot of changes here and I'm not sure when I'll have time to review this :/ I will try to find some time though.

@matyasmarkovics
Copy link
Author

Hi @Vagabond, you are right this has become a mess. Sorry about that. I would be happy to rework these changes into manageable chunks (PRs). Please let me know if that would actually work for you ;)

* Add ets (ordered_set) to collection types
* Implement strategies via out/1 of collection-types
* Use only add/2 instead of prep/2 and app/2
* Run tests with all available strategies
@matyasmarkovics
Copy link
Author

Hi again @Vagabond, I've started on spitting this PR into manageable pieces.

Here's the first chunk: #140 - Still somewhat large but I think it's manageable.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants