protected void WithNonEmptyQueue(QueueOp fn, string msg)
 {
     WithTemporaryNonExclusiveQueue((m, q) => {
         EnsureNotEmpty(q, msg);
         fn(m, q);
     });
 }
 protected void WithEmptyQueue(QueueOp fn)
 {
     WithTemporaryNonExclusiveQueue((m, q) => {
         m.QueuePurge(q);
         fn(m, q);
     });
 }
 protected void WithTemporaryQueueNoWait(IModel m, QueueOp fn, string q)
 {
     try
     {
         m.QueueDeclareNoWait(q, false, true, false, null);
         fn(m, q);
     } finally
     {
         WithTemporaryModel((tm) => tm.QueueDelete(q));
     }
 }
 protected void WithTemporaryNonExclusiveQueue(IModel m, QueueOp fn, string q)
 {
     try
     {
         m.QueueDeclare(q, false, false, false, null);
         fn(m, q);
     } finally
     {
         WithTemporaryModel((tm) => tm.QueueDelete(q));
     }
 }
Example #5
0
 public OperationObject(QueueOp next_op, String playlistName, Song song)
 {
     next_operation       = next_op;
     playlist_name_for_op = playlistName;
     song_for_op          = song;
 }
 protected void WithEmptyQueue(QueueOp fn)
 {
     WithTemporaryQueue((m, q) => {
         m.QueuePurge(q);
         fn(m, q);
     });
 }
 protected void WithNonEmptyQueue(QueueOp fn, string msg)
 {
     WithTemporaryQueue((m, q) => {
         EnsureNotEmpty(q, msg);
         fn(m, q);
     });
 }
 protected void WithNonEmptyQueue(QueueOp fn)
 {
     WithNonEmptyQueue(fn, "msg");
 }
 protected void WithTemporaryQueue(IModel m, QueueOp fn)
 {
     string q = GenerateQueueName();
     try
     {
         m.QueueDeclare(q, false, true, false, null);
         fn(m, q);
     } finally
     {
         WithTemporaryModel((tm) => tm.QueueDelete(q));
     }
 }
 protected void WithTemporaryQueue(QueueOp fn)
 {
     WithTemporaryQueue(Model, fn);
 }
 protected void WithNonEmptyQueue(QueueOp fn)
 {
     WithNonEmptyQueue(fn, "msg");
 }
 protected void WithTemporaryQueue(QueueOp fn, string q)
 {
     WithTemporaryQueue(Model, fn, q);
 }
 protected void WithTemporaryNonExclusiveQueue(IModel m, QueueOp fn)
 {
     WithTemporaryNonExclusiveQueue(m, fn, GenerateQueueName());
 }
 protected void WithTemporaryNonExclusiveQueue(QueueOp fn)
 {
     WithTemporaryNonExclusiveQueue(Model, fn);
 }
 protected void WithTemporaryQueue(QueueOp fn)
 {
     WithTemporaryQueue(Model, fn);
 }