Skip to content

Commit

Permalink
Update docs to clarify aws_io_message Cleanup Rules (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
waahm7 authored Mar 11, 2024
1 parent 66bf906 commit 2de5e86
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/aws/io/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct aws_channel_handler_vtable {
/**
* Called by the channel when a message is available for processing in the read direction. It is your
* responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it.
* You must only call `aws_mem_release(message->allocator, message);` if the `process_read_message`
* returns AWS_OP_SUCCESS. In case of an error, you must not clean up the message and should just raise the error.
*
* Also keep in mind that your slot's internal window has been decremented. You'll want to call
* aws_channel_slot_increment_read_window() at some point in the future if you want to keep receiving data.
Expand All @@ -65,6 +67,8 @@ struct aws_channel_handler_vtable {
/**
* Called by the channel when a message is available for processing in the write direction. It is your
* responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it.
* You must only call `aws_mem_release(message->allocator, message);` if the `process_read_message`
* returns AWS_OP_SUCCESS. In case of an error, you must not clean up the message and should just raise the error.
*/
int (*process_write_message)(
struct aws_channel_handler *handler,
Expand Down

0 comments on commit 2de5e86

Please sign in to comment.