Created
June 30, 2011 01:03
-
-
Save AlexCuse/1055416 to your computer and use it in GitHub Desktop.
rabbitmq subscription?
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
//I think this is more or less how it'd work | |
public IEnumerable<T> Stuffs () { | |
bool noAck = false; | |
using (var connection = connectionFactory.CreateConnection ()) | |
using (var channel = SetupChannel (connection)) { | |
var sub = new Subscription (channel, queueName, noAck); | |
while (true) { | |
var result = sub.Next (); | |
if (result != null) { | |
var output = serializer.Deserialize (result.Body); | |
yield return output; | |
sub.Ack (result); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment