Hi, On Fri, Sep 11, 2015 at 12:28 PM, Pavel Rappo <pavel.ra...@oracle.com> wrote: > Outgoing has several purposes. First of all, it separates construction of data > from sending data. Indeed, if we remove it, WebSocket will have to have many > different sendAsync variants. > Secondly it hides the notion of fragmentation. Thus not exposing a user to > many > protocol-level rules and restrictions (e.g. interjection, size restrictions, > "non-fragmentability" of control frames, etc.) > > Basically, Outgoing says: give me any complex data, I will figure out how to > send it for you. Obviously, this simplicity comes at a cost of reduced > flexibility. > > The bottom line is Outgoing will probably have to go because of the criticism.
Outgoing needs to go in its current form of an empty interface. Because Outgoing is an application-facing interface, the implementation needs methods to interact with Outgoing. Unless you can imagine all the infinite ways of sending data and provide the infinite factory methods to create Oracle-private Outgoing subclasses. If Outgoing takes another form, and defines a clear way to interact with the implementation, so that the implementation can extract data from any Outgoing implementation in an asynchronous way, less people will object to it (apart noticing that the API forces allocation ;) Thanks ! -- Simone Bordet http://bordet.blogspot.com --- Finally, no matter how good the architecture and design are, to deliver bug-free software with optimal performance and reliability, the implementation technique must be flawless. Victoria Livschitz