Repository navigation
Restoring "getBufferedAmount" in WSClient. - #76
Conversation
|
The fact that the implementation makes use of a queue at all is an implementation detail that might change over time. It the future there may be multiple queues for several executors threads or data may be written directly in the send methods if necessary even though thats unlikely to happen. However you can be sure that the data you send out will be send out via the socket as soon as possible. I'd like know in which way you depend on this information. |
|
This looks good to me. Bonus points for filling out the JavaDoc information. Thanks! |
There was a problem hiding this comment.
those changes are not necessary...
|
Ok for those who want to do sophisticated bandwidth regulation those changes are indeed helpful. The access to bufferQueueTotalAmount must be synchronized though. |
|
I'll make it synch tomorrow and update this pull request. |
Synchronize access to the "bufferedTotalQueueAmount" variable.
|
Done. |
|
thanks. |
|
I see. That actually makes absolute sense. I'll update it. |
…ver it's internal semaphore, not the WebSocket instance one.
|
What do you think? I'm making full use of auto boxing/unboxing that Java offers. |
|
I think we can merge now, even tough i don't really see the need. |
|
@Davidiusdadi If there is one thing I learned doing some Open Source development, is that your ideas are just a "starting point" for others to build on. Most of the time, you think to do X and Y with your idea. But other come along and make X+1, Y-1 and all sort of Z. It's the beauty of open sourcing code: you produce something, other people either build on it or extend it to cover more scenario. In this case the "bufferedAmount" is a property of the WS official specs: if not now, later on someone will come along explaining why they need it for reason Z+1. Unless you can see an harm in this, just get along dude... |
|
Thanks for the inspiration |
|
@Davidiusdadi I love your attitude man. It's like being punched for contributing. |
|
@detro I really respect your endurance. Hopefully we can work together on a feature we both endorse in the future. |
Adding/Restoring "getBufferedAmount" in WSClient.
No description provided.