A way to flush/deliver messages before disconnecting
See original GitHub issueIssue Description
Hey folks,
We are currently sending some messages, and based on a flag disconnect the clients if the conversation/process is finished. If so, we call client.disconnect()
on it to make sure the client no longer keeps the connection open.
However, this is causing client to disconnect even before receiving the messages. I was hoping to have a client.disconnect(flushBeforeDisconnectBoolean)
or a simple method as client.flush
that sends all messages by blocking the call.
Is there a way to send messages and then wait for it to be delivered before disconnecting the client ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Sending Disconnect Messages #533 - vis2k/Mirror - GitHub
I need this in uMMORPG as well. right now I have a workaround where I send an error message without disconnecting, and the...
Read more >Connecting to and disconnecting from a queue manager - IBM
They can use the MQDISC call to disconnect from that queue manager. Following an IMS call that establishes a syncpoint, and before processing...
Read more >Add or remove your phone number in Messages or FaceTime
On your iPhone: Go to Settings > Messages and make sure that iMessage is on. You might need to wait a moment for...
Read more >Django Channels - Not Able to Send Messages on Disconnect
1. Each WebsocketConsumer has a websocket_disconnect function defined which removes the groups currently assigned to the websocket before ...
Read more >Slack Connect: Disconnect from an organization
You can disconnect from an organization to end all communication with them in Slack Connect channels and direct messages (DMs).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jaypatel512 this is already possible in CometD 4:
If you like Java’s
CompletableFuture
, usePromise.Completable
(a subclass of Java’sCompletableFuture
):You have to clarify what you mean exactly by “disconnect”. CometD disconnect message? TCP disconnect?
The server side promise cannot wait for the browser. The server side promise is completed as soon as the TCP write succeeds (or fails). Whether the message will arrive to the client, that is unknown to the server, and the server cannot wait. It may still happen, however, that the messages and the disconnect message (from server to client) travel onto 2 different TCP connections and therefore there is no guarantee of ordering between the messages and the disconnect message.
The
ack
extension guarantees ordered delivery.