Created
July 2, 2012 05:34
-
-
Save paulduran/3031281 to your computer and use it in GitHub Desktop.
blocking pop swallowing messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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