Skip to content

Instantly share code, notes, and snippets.

@timsavery
Last active December 10, 2015 21:48
Show Gist options
  • Save timsavery/4497238 to your computer and use it in GitHub Desktop.
Save timsavery/4497238 to your computer and use it in GitHub Desktop.
The Message Class
public class Message {
private readonly IModel _model;
private readonly dynamic _body;
private readonly ulong _deliveryTag;
public dynamic Body {
get { return this._body; }
}
internal Message(IModel model, ulong deliveryTag, dynamic body) {
this._body = body;
this._model = model;
this._deliveryTag = deliveryTag;
}
public void Ack() {
this._model.BasicAck(this._deliveryTag, false);
}
public void Reject() {
this._model.BasicReject(this._deliveryTag, false);
}
public void ReTry() {
this._model.BasicReject(this._deliveryTag, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment