Skip to content

Commit

Permalink
Add handle_send_result callback
Browse files Browse the repository at this point in the history
The current way of sending messages via `handle_cast`, `handle_info`
callbacks doesn't allow the user to know whether the message was sent
successfully or not. This is particularly important now that a
connection might be in a backoff state for a long time.

This adds a new callback, `handle_send_result` which gets called on
success or error of processing a message to be sent. Note that this
doesn't apply to `send_frame` since that is synchronous and already
provides feedback. This isn't named `handle_reply_result` because I
believe `:reply` should be renamed since it only makes sense in
`handle_frame`, but not in `handle_cast` and `handle_info`.

This also allows passing through a key to correlate a result with a send
request.
  • Loading branch information
Brendan Ball committed Jun 17, 2022
1 parent 4bc70db commit 0b5c9a1
Show file tree
Hide file tree
Showing 6 changed files with 314 additions and 65 deletions.
Loading

0 comments on commit 0b5c9a1

Please sign in to comment.