| 1 |
#------------------------------------------------------------------------- |
| 2 |
# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 |
# Licensed under the MIT License. See License.txt in the project root for |
| 4 |
# license information. |
| 5 |
#-------------------------------------------------------------------------- |
| 6 |
|
| 7 |
from libc cimport stdint |
| 8 |
|
| 9 |
cimport c_message |
| 10 |
cimport c_link |
| 11 |
cimport c_async_operation |
| 12 |
cimport c_amqp_definitions |
| 13 |
cimport c_amqpvalue |
| 14 |
|
| 15 |
|
| 16 |
cdef extern from "azure_uamqp_c/message_sender.h": |
| 17 |
|
| 18 |
cdef enum MESSAGE_SEND_RESULT_TAG: |
| 19 |
MESSAGE_SEND_OK, |
| 20 |
MESSAGE_SEND_ERROR, |
| 21 |
MESSAGE_SEND_TIMEOUT, |
| 22 |
MESSAGE_SEND_CANCELLED |
| 23 |
|
| 24 |
cdef enum MESSAGE_SENDER_STATE_TAG: |
| 25 |
MESSAGE_SENDER_STATE_IDLE, |
| 26 |
MESSAGE_SENDER_STATE_OPENING, |
| 27 |
MESSAGE_SENDER_STATE_OPEN, |
| 28 |
MESSAGE_SENDER_STATE_CLOSING, |
| 29 |
MESSAGE_SENDER_STATE_ERROR |
| 30 |
|
| 31 |
ctypedef struct MESSAGE_SENDER_HANDLE: |
| 32 |
pass |
| 33 |
|
| 34 |
ctypedef void (*ON_MESSAGE_SEND_COMPLETE)(void* context, MESSAGE_SEND_RESULT_TAG send_result, c_amqpvalue.AMQP_VALUE delivery_state) |
| 35 |
ctypedef void (*ON_MESSAGE_SENDER_STATE_CHANGED)(void* context, MESSAGE_SENDER_STATE_TAG new_state, MESSAGE_SENDER_STATE_TAG previous_state) |
| 36 |
|
| 37 |
MESSAGE_SENDER_HANDLE messagesender_create(c_link.LINK_HANDLE link, ON_MESSAGE_SENDER_STATE_CHANGED on_message_sender_state_changed, void* context) |
| 38 |
void messagesender_destroy(MESSAGE_SENDER_HANDLE message_sender) |
| 39 |
int messagesender_open(MESSAGE_SENDER_HANDLE message_sender) |
| 40 |
int messagesender_close(MESSAGE_SENDER_HANDLE message_sender) |
| 41 |
c_async_operation.ASYNC_OPERATION_HANDLE messagesender_send_async(MESSAGE_SENDER_HANDLE message_sender, c_message.MESSAGE_HANDLE message, ON_MESSAGE_SEND_COMPLETE on_message_send_complete, void* callback_context, c_amqp_definitions.tickcounter_ms_t timeout) |
| 42 |
void messagesender_set_trace(MESSAGE_SENDER_HANDLE message_sender, bint traceOn) |