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

Introduce client pool #83

Closed
wants to merge 2 commits into from
Closed

Introduce client pool #83

wants to merge 2 commits into from

Conversation

picanumber
Copy link

@picanumber picanumber commented Sep 25, 2021

The client pool is used to create the desired number of client instances which are accessible in a thread safe fashion.

Different threads can assign a task to the pool, by calling the ::run method; this is a method that accepts a callback with a signature <Ret(client *)> where Ret is any type. Inside that callback, the provided client is accessed in a thread safe manner.

Selection of an idle client from the pool is done in a round robin fashion and will wait to find an idle "worker" when all clients in the pool are busy.

Also added an example.

The client pool is used to create the desired number of client instances
which are accessible in a thread safe fashion.
@picanumber picanumber closed this by deleting the head repository Oct 19, 2022
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.

1 participant