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

remove bad PooledClient from pool #10

Open
ghost opened this issue Apr 26, 2016 · 0 comments
Open

remove bad PooledClient from pool #10

ghost opened this issue Apr 26, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 26, 2016

I have code like this:

public static async Task Publish(string endpt, int db, string channel, String msg)
{
using (var bc = await _boostClientPool.CreateClientAsync(endpt, 6379, db))
{
return await bc.PublishAsync(channel, msg);
}
}

If for some reason an IO exception occurs in the PublishAsync call, I want the client instance to be removed from from the pool otherwise it gets readded when bc is disposed (because it's really a PooledRedisClient which returns itself to the pool on dispose). I've run into situations where this results in an unusable client instance (say due to prior disconnect) being pulled from the pool and failing for subsequent calls to Publish(). Is there a way to do this?

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

No branches or pull requests

0 participants