--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC_ixdxfRa%3DBa_wRhq5g1MRq1brKxWJs93SY33F1FBrBKJf4%2BA%40mail.gmail.com.
ws.onmessage = evt => process(evt.data);
process()
to complete before calling it again; How do you suspend in process in order for onmessage to fire again? You'd have to get back to the event dispatch.
Personally; and I'm not sure what to blame it on, call it being a conservative; I don't see that promises do anything other than wrap two callbacks instead of 1, and just make code more complex for no reason; I'd be happier with a change to more like addEventListener like `websock.on( "message", ... );`
While addressing shortcomings, could also implement an API to expose the ping functionality of the websocket protocol; a successful ping response means your message queue is empty... it does add extra latency between large packets.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAA2GJqWiFdhGTSx%3D5Q8AS8sj8JsgrMtUUBF2z9csY3FB3tPvWw%40mail.gmail.com.
Maybe I should have just replied as an issue... could edit that.
I have this c library I use; https://www.npmjs.com/package/sack.vfs#websocket-module and not that it directly relates,
but I did add a callback on server/client sockets to get event notification as fragments completed. I didn't forward that to JS yet.
And aren't there other options for perMessageDeflateAllow, perMessageDeflate something?
Also, the callbacks could be specified in the constructor option object ( another feature I don't do there ) but the tcp/udp sockets and I think HTTP(S) constructors can specify all event handlers it all in one option object (websocks is sort of a 4-way promise).
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAA2GJqV6cdjG2MAaOEptvprO44gDRxj5ubDt48CedHbWxFuUcQ%40mail.gmail.com.
--
Maybe I should have just replied as an issue... could edit that.
I have this c library I use; https://www.npmjs.com/package/sack.vfs#websocket-module and not that it directly relates,
but I did add a callback on server/client sockets to get event notification as fragments completed. I didn't forward that to JS yet.In Chromium we treat frames as an implementation detail and make no effort to preserve frame boundaries.
And aren't there other options for perMessageDeflateAllow, perMessageDeflate something?The server controls whether or not permessage-deflate is used during the handshake. So I think having an additional control in client-side JavaScript would be redundant.
On Fri, Jul 12, 2019 at 6:46 AM Adam Rice <ri...@chromium.org> wrote:In Chromium we treat frames as an implementation detail and make no effort to preserve frame boundaries.
I do too.....
Just curious, are you working with any partner sites to identify use cases and evaluate the effectiveness of the new API?
For this particular case of writable backpressure, there's a simple solution already deployed for WebRTC data channels (which have a nearly identical API as the WebSocket API). See https://bugs.chromium.org/p/webrtc/issues/detail?id=4616 for an explanation fo the "onbufferedamountlow" event. This prevents the need to poll the bufferedAmount property.
In designing this new interface, can we please ensure that it also works for WebRTC data channels? We should be unifying around a single interface for these APIs, not diverging them even further.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/549de011-3935-4d5e-8524-b3197381594e%40chromium.org.
Hey Adam, this is great work. Quite similar to what I proposed for WebRTC data channels as well.
I don't think WebTransport should or will be limited to QUIC, so I don't understand why this API cannot be incorporated into it. It would be the perfect opportunity to combine efforts here and the WebTransport folks could use someone who has experience with the streams API since they are migrating their API to use the streams API as well. So, I think it's about weighing up a quick improvement vs. a mid-term win. And, personally, I'd prefer the mid-term win instead of having two largely similar APIs at the end. People have settled with polling bufferedAmount for now. It's not great but they can wait a little longer and benefit from a less fragmented API surface. (/cc Peter)
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ad140afc-e235-40a4-9ec4-d1f05080367d%40chromium.org.
I recall discussing this approach in the past for WebSockets, but I didn't know that WebRTC had implemented it. I suspect that it leads to convoluted logic, but I'd be happy to be proved wrong.
I'm confident this design can be used for WebRTC data channels, but I'm concentrating on proving it for WebSockets first.
For the case of streaming individual messages, I'm excited about what @martinthompson proposed here, which is that we can use a subclass of the body mixin from the fetch standard as a message representation. This avoids the mental confusion of talking about streams-of-streams, and also brings for free the swiss-army-knife nature of the Response object--you can create a message from anything (including a stream) and read a message as anything (including a stream).
I don't think it's an and/or choice. WebTransport is solving a significantly harder problem, and will have a larger API as a result. In the meantime, developers can play with the WebSocketStream API (available behind a flag Real Soon Now) and we find out where the bumps are.One possible outcome of this is that we don't ship WebSocketStream and we fold what we learned into the WebTransport API. But I like to think WebSocketStream will be independently useful as a small API that solves an immediate problem.
Hey Adam, this is great work. Quite similar to what I proposed for WebRTC data channels as well.For the case of streaming individual messages, I'm excited about what @martinthompson proposed here, which is that we can use a subclass of the body mixin from the fetch standard as a message representation. This avoids the mental confusion of talking about streams-of-streams, and also brings for free the swiss-army-knife nature of the Response object--you can create a message from anything (including a stream) and read a message as anything (including a stream).This will not be a version 1 feature. I currently envision that we'll need bring-your-own-buffer binary streams first.I don't think WebTransport should or will be limited to QUIC, so I don't understand why this API cannot be incorporated into it. It would be the perfect opportunity to combine efforts here and the WebTransport folks could use someone who has experience with the streams API since they are migrating their API to use the streams API as well. So, I think it's about weighing up a quick improvement vs. a mid-term win. And, personally, I'd prefer the mid-term win instead of having two largely similar APIs at the end. People have settled with polling bufferedAmount for now. It's not great but they can wait a little longer and benefit from a less fragmented API surface. (/cc Peter)I don't think it's an and/or choice. WebTransport is solving a significantly harder problem, and will have a larger API as a result. In the meantime, developers can play with the WebSocketStream API (available behind a flag Real Soon Now) and we find out where the bumps are.One possible outcome of this is that we don't ship WebSocketStream and we fold what we learned into the WebTransport API. But I like to think WebSocketStream will be independently useful as a small API that solves an immediate problem.
On Tue, 6 Aug 2019 at 22:55, <lennar...@gmail.com> wrote:
--Hey Adam, this is great work. Quite similar to what I proposed for WebRTC data channels as well.I don't think WebTransport should or will be limited to QUIC, so I don't understand why this API cannot be incorporated into it. It would be the perfect opportunity to combine efforts here and the WebTransport folks could use someone who has experience with the streams API since they are migrating their API to use the streams API as well. So, I think it's about weighing up a quick improvement vs. a mid-term win. And, personally, I'd prefer the mid-term win instead of having two largely similar APIs at the end. People have settled with polling bufferedAmount for now. It's not great but they can wait a little longer and benefit from a less fragmented API surface. (/cc Peter)That being said, again, it's great to see progress in this area and you can ping me in IRC (lgrahl) if you want to discuss anything in detail.CheersLennart
On Friday, 12 July 2019 05:07:16 UTC+2, Adam Rice wrote:ri...@chromium.org,yhi...@chromium.org https://github.com/ricea/websocketstream-explainer/blob/master/README.md https://docs.google.com/document/d/1XuxEshh5VYBYm1qRVKordTamCOsR-uGQBCYFcHXP4L0/edit https://github.com/w3ctag/design-reviews/issues/394 The WebSocket API provides a JavaScript interface to the RFC6455 WebSocket protocol. While it has served well, it is awkward from an ergonomics perspective and is missing the important feature of backpressure. The intent of the WebSocketStream API is to resolve these deficiencies by integrating streams with the WebSocket API. Currently applying backpressure to received messages is not possible with the WebSocket API. When messages arrive faster than the page can handle them, the render process will either fill up memory buffering those messages, become unresponsive due to 100% CPU usage, or both. Applying backpressure to sent messages is possible but involves polling the bufferedAmount property which is inefficient and unergonomic.The main risk is that it fails to become an interoperable part of the web platform if other browsers do not implement it. Firefox: No public signals Edge: No public signals Safari: No public signals Web developers: No signals A major focus of the new API is improving ergonomics over the existing WebSocket API. Everything except for correct backpressure behaviour can be polyfilled. Developers who are sensitive to backpressure may prefer to feature-detect and fall back to application-level backpressure if the feature is not available. Security posture is the same as the existing WebSocket API.The necessary probes will be included in the code so that existing WebSocket debugging facilities should work as-is. Yes The feature is easy to support everywhere existing Blink WebSocket support exists. Blink WebSockets are supported on every Blink platform. No The feature will be tested in web platform tests. https://chromestatus.com/feature/5189728691290112This intent message was generated by Chrome Platform Status.
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blin...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJrXDUGFL-_3QTP8m15eYyJHPAtCFWCzGOEmbsYU%3D9E-%2BzQsBg%40mail.gmail.com.
So why don't we move websocket handling to web worker instead? In that way, main thread won't be blocked by the flood of messages.
Also, pressure controlling is very important to real message systems. I don't think serious websocket use cases will ignore this in their application layer. If server have totally no idea whether clients can consume the messages, then it also means data will be pending inside server's memory due to bandwidth differences, which may be a problem to the message system itself.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMQP3LSwnTf0GS8jxr-gjOBhfL17czo1X7gjMuMQNe_b1%3DM%3Dyw%40mail.gmail.com.