Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MQUser
- {
- readonly IModel channel;
- public MQUser(IModel channel)
- {
- this.channel = channel;
- }
- public void DoStuff()
- {
- var queueName = channel.QueueDeclare();
- var subscription = new Subscription(channel, queueName);
- do
- {
- var msg = subscription.Next();
- // Do stuff with the message
- subscription.Ack(msg);
- } while (!aborted);
- }
- bool aborted;
- public void Abort()
- {
- aborted = true;
- }
- }
Add Comment
Please, Sign In to add comment