[undertow-dev] WebSocket sending back pressure

peter royal peter.royal at pobox.com
Thu Jul 7 08:27:11 EDT 2016


The flush method on *FrameSinkChannel channels? I could use that to see
if a message had been sent, but how might that be incorporated into a
back pressure algorithm? 

At my application level I have the notion of a 'topic' that a WS message
is sent on. For most topics only the most recent message is the one that
matters. For those topics I was going to use the WebSocketCallback to
only allow one at a time to be queued on the WebSocketChannel.

-pete

-- 
(peter.royal|osi)@pobox.com - http://fotap.org/~osi

On Thu, Jul 7, 2016, at 07:13 AM, Jason T. Greene wrote:
> There is also a flush method on the channel if it's helpful.
> 
> > On Jul 7, 2016, at 7:10 AM, peter royal <peter.royal at pobox.com> wrote:
> > 
> > I looked some more and cancellation would be a huge change - I'm going
> > to see how far I can get by using the existing callback for flow
> > control.
> > 
> > -pete
> > 
> > -- 
> > (peter.royal|osi)@pobox.com - http://fotap.org/~osi
> > 
> >> On Wed, Jul 6, 2016, at 09:43 PM, Stuart Douglas wrote:
> >> Some of the methods take a WebSocketCallback that will notify you on
> >> completion or error, however at the moment there is no way to cancel a
> >> message.
> >> 
> >> Stuart
> >> 
> >> On Thu, Jul 7, 2016 at 6:56 AM, peter royal <peter.royal at pobox.com>
> >> wrote:
> >>> I am finding that sometimes I have WebSocket connections that are unable
> >>> to flush messages out the socket at the rate I am generating messages.
> >>> 
> >>> I'm using the core.WebSockets class to send messages. Is it possible to
> >>> achieve this with what exists currently? My initial guess is no..
> >>> conceptually it would be nice for core.WebSockets to return a
> >>> CompletableFuture-style object that would let me get a callback when the
> >>> message is sent, or have the ability to cancel it if it is still sitting
> >>> in the send queue.
> >>> 
> >>> I'm happy to help build something into Undertow if it is a welcome
> >>> addition.
> >>> 
> >>> -pete
> >>> 
> >>> --
> >>> (peter.royal|osi)@pobox.com - http://fotap.org/~osi
> >>> _______________________________________________
> >>> undertow-dev mailing list
> >>> undertow-dev at lists.jboss.org
> >>> https://lists.jboss.org/mailman/listinfo/undertow-dev
> > _______________________________________________
> > undertow-dev mailing list
> > undertow-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list