public void Remove(string key)
public void RemoveDependentsOf(string key)
var setKey = GetDependencySetKey(key);
RedisValue dependents = _redis.SetMembers(setKey);
foreach (var dependentKey in dependents)
// This is the way to remove the whole set
You’re using synchronous methods and, although you don’t explicitly depend on the result of the
KeyDelete operation, StackExchange.Redis doesn’t know that you’re not using the result. You are therefore not getting any of the pipelining benefits offered by the library.
The documentation explicitly calls out the two ways that you can use the pipelining support; use the Async method and perform a
Task.WhenAll if you want to know when it’s done or use Fire and Forget. You can explicitly tell the library that you want to do this by passing
CommandFlags.FireAndForget to your commands, e.g.
Note this will cause a default result to be returned from the call rather than the actual result. Given that you are disregarding those results anyway you should be OK!