Azure / azure-uamqp-c

AMQP library for C
Other
60 stars 63 forks source link

Change amqp_management and cbs to return async_operation_handles #387

Closed ewertons closed 3 years ago

ewertons commented 3 years ago

This change will allow the calling layer to cancel CBS put-token and delete-token operations, avoiding callbacks hitting contexts that have already been destroyed.

dcristoloveanu commented 3 years ago

MOCKABLE_FUNCTION(, int, cbs_delete_token_async, CBS_HANDLE, cbs, const char, type, const char, audience, ON_CBS_OPERATION_COMPLETE, on_cbs_delete_token_complete, void*, on_cbs_delete_token_complete_context);

This does not match, it should be ASYNC_OPERATION_HANDLE


Refers to: devdoc/cbs_requirements.md:122 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)

dcristoloveanu commented 3 years ago

MOCKABLE_FUNCTION(, int, cbs_put_token_async, CBS_HANDLE, cbs, const char, type, const char, audience, const char, token, ON_CBS_OPERATION_COMPLETE, on_cbs_put_token_complete, void, on_cbs_put_token_complete_context);

ASYNC_OPERATION_HANDLE


Refers to: devdoc/cbs_requirements.md:101 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)

dcristoloveanu commented 3 years ago

int amqp_management_execute_operation_async(AMQP_MANAGEMENT_HANDLE amqp_management, const char operation, const char type, const char locales, MESSAGE_HANDLE message, ON_AMQP_MANAGEMENT_EXECUTE_OPERATION_COMPLETE on_execute_operation_complete, void on_execute_operation_complete_context);

ASYNC_OPERATION_HANDLE


Refers to: devdoc/amqp_management_requirements.md:178 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)

dcristoloveanu commented 3 years ago
MOCKABLE_FUNCTION(, int, amqp_management_execute_operation_async, AMQP_MANAGEMENT_HANDLE, amqp_management, const char*, operation, const char*, type, const char*, locales, MESSAGE_HANDLE, message, ON_AMQP_MANAGEMENT_EXECUTE_OPERATION_COMPLETE, on_execute_operation_complete, void*, context);

ASYNC_OPERATION_HANDLE


Refers to: devdoc/amqp_management_requirements.md:34 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)

dcristoloveanu commented 3 years ago
MOCKABLE_FUNCTION(, int, cbs_put_token_async, CBS_HANDLE, cbs, const char*, type, const char*, audience, const char*, token, ON_CBS_OPERATION_COMPLETE, on_cbs_put_token_complete, void*, on_cbs_put_token_complete_context);

ASYNC_OPERATION_HANDLE


Refers to: devdoc/cbs_requirements.md:34 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)

dcristoloveanu commented 3 years ago
MOCKABLE_FUNCTION(, int, cbs_delete_token_async, CBS_HANDLE, cbs, const char*, type, const char*, audience, ON_CBS_OPERATION_COMPLETE, on_cbs_delete_token_complete, void*, on_cbs_delete_token_complete_context);

ASYNC_OPERATION_HANDLE


Refers to: devdoc/cbs_requirements.md:35 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)

dcristoloveanu commented 3 years ago
STRICT_EXPECTED_CALL(amqpvalue_create_string("blah_token"))

Same comment for this file. I'd expect at least one new test that would somehow trigger a cancel and check that the item has been removed from the list.


Refers to: tests/cbs_ut/cbs_ut.c:885 in 3dac612. [](commit_id = 3dac612d20c7dbb3b655b44c6eed9cc6738d3a0d, deletion_comment = False)