Guest User

Untitled

a guest
Jul 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public class MQUser
  2. {
  3. readonly IModel channel;
  4.  
  5. public MQUser(IModel channel)
  6. {
  7. this.channel = channel;
  8. }
  9.  
  10. public void DoStuff()
  11. {
  12. var queueName = channel.QueueDeclare();
  13. var subscription = new Subscription(channel, queueName);
  14. do
  15. {
  16. var msg = subscription.Next();
  17. // Do stuff with the message
  18. subscription.Ack(msg);
  19. } while (!aborted);
  20. }
  21.  
  22. bool aborted;
  23. public void Abort()
  24. {
  25. aborted = true;
  26. }
  27. }
Add Comment
Please, Sign In to add comment