ok2c commented on PR #3235:
URL: https://github.com/apache/cxf/pull/3235#issuecomment-4743009066

   @reta Damn. One needs to be extremely careful here. 
   
   1. Classic `InputSteam` / `OutputStream` abstraction is inherently blocking. 
It just does not mix well with an event driven i/o model. 
   
   2. If at any point the data producer signals zero data availability, the 
protocol handler can choose to disable output interest for the channel and let 
it go to sleep. That means no more output for that channel until the producer 
signals its readiness to produce more through 
`DataStreamChannel#requestOutput`. The trouble is the actual data stream 
producer is hidden behind that `InputStream` and it basically has no way of 
pushing data through `DataStreamChannel` or requesting output. That means the 
channel will remain stuck in sleep mode (no output interest).
   
   Sadly, i do not see elegant way of solving this issue. One either must use 
an extra thread to read data from the blocking `InputSteam` or always return 
**non-zero** data availability to ensure the channel cannot go to sleep. This, 
of course, basically means the i/o reactor event loop will be running hot.
   
   Can you represent your data as anything other than `InputSteam`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to