diff options
author | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-03-30 21:28:20 -0400 |
---|---|---|
committer | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-03-30 21:28:20 -0400 |
commit | 78361421f8ce0533a7f2df9f745e5ac838da05d3 (patch) | |
tree | 5e40b748ad1f7452f6612e56065fc41f044f2b0c /librabbitmq | |
parent | 333d8fa3accf1df86b464265f5bb9e8d88e63b5c (diff) | |
download | rabbitmq-c-github-ask-78361421f8ce0533a7f2df9f745e5ac838da05d3.tar.gz |
Add TX select, commit, rollback
Diffstat (limited to 'librabbitmq')
-rw-r--r-- | librabbitmq/amqp.h | 9 | ||||
-rw-r--r-- | librabbitmq/amqp_api.c | 32 |
2 files changed, 39 insertions, 2 deletions
diff --git a/librabbitmq/amqp.h b/librabbitmq/amqp.h index 9981275..139de5d 100644 --- a/librabbitmq/amqp.h +++ b/librabbitmq/amqp.h @@ -461,6 +461,15 @@ extern struct amqp_queue_purge_ok_t_ *amqp_queue_purge(amqp_connection_state_t s amqp_bytes_t queue, amqp_boolean_t no_wait); +extern struct amqp_tx_select_ok_t_ *amqp_tx_select(amqp_connection_state_t state, + amqp_channel_t channel); + +extern struct amqp_tx_commit_ok_t_ *amqp_tx_commit(amqp_connection_state_t state, + amqp_channel_t channel); + +extern struct amqp_tx_rollback_ok_t_ *amqp_tx_rollback(amqp_connection_state_t state, + amqp_channel_t channel); + /* * Can be used to see if there is data still in the buffer, if so * calling amqp_simple_wait_frame will not immediately enter a diff --git a/librabbitmq/amqp_api.c b/librabbitmq/amqp_api.c index 66b1f3d..91b0bf8 100644 --- a/librabbitmq/amqp_api.c +++ b/librabbitmq/amqp_api.c @@ -253,7 +253,8 @@ amqp_queue_purge_ok_t *amqp_queue_purge(amqp_connection_state_t state, { state->most_recent_api_result = AMQP_SIMPLE_RPC(state, channel, QUEUE, PURGE, PURGE_OK, - amqp_queue_purge_t, channel, queue, no_wait); + amqp_queue_purge_t, + 0, queue, no_wait); return RPC_REPLY(amqp_queue_purge_ok_t); } @@ -268,10 +269,37 @@ amqp_rpc_reply_t amqp_basic_get(amqp_connection_state_t state, state->most_recent_api_result = AMQP_MULTIPLE_RESPONSE_RPC(state, channel, BASIC, GET, replies, amqp_basic_get_t, - channel, queue, no_ack); + 0, queue, no_ack); return state->most_recent_api_result; } +amqp_tx_select_ok_t *amqp_tx_select(amqp_connection_state_t state, + amqp_channel_t channel) +{ + state->most_recent_api_result = + AMQP_SIMPLE_RPC(state, channel, TX, SELECT, SELECT_OK, + amqp_tx_select_t); + return RPC_REPLY(amqp_tx_select_ok_t); +} + +amqp_tx_commit_ok_t *amqp_tx_commit(amqp_connection_state_t state, + amqp_channel_t channel) +{ + state->most_recent_api_result = + AMQP_SIMPLE_RPC(state, channel, TX, COMMIT, COMMIT_OK, + amqp_tx_commit_t); + return RPC_REPLY(amqp_tx_commit_ok_t); +} + +amqp_tx_rollback_ok_t *amqp_tx_rollback(amqp_connection_state_t state, + amqp_channel_t channel) +{ + state->most_recent_api_result = + AMQP_SIMPLE_RPC(state, channel, TX, ROLLBACK, ROLLBACK_OK, + amqp_tx_rollback_t); + return RPC_REPLY(amqp_tx_rollback_ok_t); +} + amqp_rpc_reply_t amqp_get_rpc_reply(amqp_connection_state_t state) { return state->most_recent_api_result; |