On Wed, Sep 21, 2016 at 11:51 AM, Bill Erickson <beric...@gmail.com> wrote: > > On Wed, Sep 21, 2016 at 10:44 AM, Bill Erickson <beric...@gmail.com> wrote: >> >> >> /osrf-http-translator provides a lower level OpenSRF API and supports >> streaming responses, but its use is no longer encouraged, because the >> underlying mechanism (multipart/x-mixed-replace) is deprecated and only >> works with our old version of XULRunner. This interface will likely be >> deprecated along with the XUL client. >> > > Couple of additional comments for those following along... > > 1. The multipart/x-mixed-replace part of the translator only affects its > ability to stream results. Without this, it's less efficient / fast, but > still works. You just can't use it for API calls that return large result > sets or for real-time use of individual results. The OpenSRF API/session > support works regardless. > > 2. Various HTML interfaces outside of the XUL client proper (primarily ACQ > and admin UI's) use the translator. All of these would have to be ported to > websockets before we could consider deprecation. >
Meaning, in the end, it'll be a while before the translator goes away, or is even deprecated except for streaming. In addition to the core users, it's simpler (admin- and code-wise) on both ends than WebSockets for little things and has the benefit of being able to supply transactional semantics even in a clustered environment, which I don't think our WebSockets implementation can do today (though, if it can, please do correct me!). Some background on the technology: even though some browsers don't support multipart/x-mixed-replace (most, other than IE, do at least for images -- it's used for simple webcam apps) we were far from the first to use it, and it's fairly trivial to implement on the client side. FWIW, curl supports it, so I wouldn't be too surprised to find clients in the wild using it. All that said, WebSockets is way better and if you write a new (future) client that uses the translator and multipart/x-mixed-replace for streaming then you are a bad person and you should feel bad. :) --Miker