19

Building a wheel is great.
Building a steering wheel is also great
Building a brakes pedal is amazing.

Making them work asynchronously - not that good of an idea is it...

Who the fuck thought separating data stream (copying bytes) from stream control (when does the stream start/end) is a good idea...?

- open a connection
- send data to the stream
- send() returns
- close the connection

Apparently, the send() does not copy the data and returns. Instead, it enqueues the data copying task end returns. When does the actual copying start? IDK. When does it end? IDK. Can I close the conn? NO!

This thing is UNUSABLE. And I'd riddle it with reflection-based workarounds if it weren't for the static methods.

Fuck!

Comments
  • 1
    @halfflat I don't mind asynchronous execution. I'm all in for it. As long as I can check the task's state at any given time!

    With kube client this is not the case. IDK where they got that OKHttp lib from (can't find that class in their GH), but they are using THAT: https://github.com/wangweijun123/... . Deep deep inside. Behind a static context.

    Sooo.. my current workaround - connect to the pod in a separate websocket and monitor the data stream in the shell. As soon as no data is received in last 5seconds poll - call it a complete data push.

    ffs..... I want to kick someone
  • 1
    I was a bit dissapointed when I realized this post wasn't about repairing cars
  • 0
    Been a long time since I've used okhttp, but can't you pass a "Callback" to be notified on completion after you fire off an astnc request?
Add Comment