Skip to content

Instantly share code, notes, and snippets.

@paulduran
Created July 2, 2012 05:34
Show Gist options
  • Save paulduran/3031281 to your computer and use it in GitHub Desktop.
Save paulduran/3031281 to your computer and use it in GitHub Desktop.
blocking pop swallowing messages
public static void DumpJobs()
{
var client = new RedisConnection(Host, password: Password);
client.Open();
using (client)
{
while (true)
{
try
{
Console.Out.WriteLine("getting job");
var result = client.Wait(client.Lists.BlockingRemoveFirstString(0, new[] {"myqueue"}, 0));
Console.Out.WriteLine("got job from queue: {0} . job data: {1}", result.Item1, result.Item2);
} catch(TimeoutException)
{
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment