websocket-ts icon indicating copy to clipboard operation
websocket-ts copied to clipboard

Async version of send

Open hpx7 opened this issue 3 years ago • 5 comments

I would like a way to be able to determine when my message actually gets sent or whether it gets dropped from the buffer. Would you consider adding an async version of send which returns a Promise? The promise would resolve when the message gets sent (immediately if there is an active connection), and be rejected when the message gets dropped from the buffer.

hpx7 avatar Jul 15 '21 18:07 hpx7

thanks for the suggestion. i think it's a great idea. let me tinker around with this for a little, i'll include it with the next release if i'm happy with the result.

jjxxs avatar Jul 19 '21 18:07 jjxxs

hey @jjxxs did you ever get a chance to play around with this?

hpx7 avatar Feb 01 '22 01:02 hpx7

hi @hpx7! i didn't work on this yet but didn't forget about this either. since this has been open for a long time now and i am currently working on web-projects again i'll prioritize this since i think it's a good idea. give me another week or two please and you should see some progress. cheers!

jjxxs avatar Feb 04 '22 11:02 jjxxs

@jjxxs just wanted to check in and see if you're still considering implementing this?

hpx7 avatar Jun 04 '22 17:06 hpx7

@jjxxs Hi. If I implement this behavior and create PR, can you check in merge it if it's ok?

whalemare avatar Oct 15 '22 05:10 whalemare