Skip to content

Commit

Permalink
Merge pull request ServiceStack#40 from cbarbara/7b75efa9da08c72c5e8a…
Browse files Browse the repository at this point in the history
…c50966265e0f6a37cae2

A faster way to put clients back in the pool
  • Loading branch information
mythz committed May 10, 2012
2 parents e8369be + 7b75efa commit e50d86d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/ServiceStack.Redis/PooledRedisClientManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,32 @@ public void DisposeClient(RedisNativeClient client)
if (client.IsDisposed) return;

throw new NotSupportedException("Cannot add unknown client back to the pool");
}

/// <summary>
/// Disposes the read only client.
/// </summary>
/// <param name="client">The client.</param>
public void DisposeReadOnlyClient( RedisNativeClient client )
{
lock( readClients )
{
client.Active = false;
Monitor.PulseAll( readClients );
}
}

/// <summary>
/// Disposes the write client.
/// </summary>
/// <param name="client">The client.</param>
public void DisposeWriteClient( RedisNativeClient client )
{
lock( writeClients )
{
client.Active = false;
Monitor.PulseAll( writeClients );
}
}

public void Start()
Expand Down

0 comments on commit e50d86d

Please sign in to comment.