8

/** Null until this web socket is connected. Used for writes, pings, and close timeouts. */
private ScheduledExecutorService executor;

Dear boys and girls.
If you ever do this again and release this as a public library (even better - an official client of your solution, e.g. kuber-fucking-netes), I will get my way into dR's gateway servers, trace down your IP in nginx's logs, find your location, probably use some means to get your first and last name (you prolly have a domain registered under your IP anyways...), buy a ticket to your town, get to your home and wait for night to fall. Once it's dark and you're asleep, I'll make sure to leave a real nice, warm and extraordinarily smelly turd on your doorstep (I'll also make sure the process of manufacturing that gem is as noisy as it gets - you just have to bend the right way, and....).

Gents. If you really, REALLY want to make writes asynchronous, at least provide a way to either get a notification once the write is synchronized, or allow the user to handle the threads/executors himself!

https://youtube.com/watch/...

Comments
  • 1
    Yeah, that should be a CompleteableFuture<ScheduledExecutorService>,

    Asynchronous stuff in Java is still kinda a mess, and always will be tbh. CompleteableFuture made it kinda sane in Java 8, more modern frameworks like Reactor make it much better, but it's never going to fit with the language very well unless they make some reasonably fundamental changes.
  • 1
    @AlmondSauce what is wrong with fibers?
  • 1
    @AlmondSauce umm.. what? What's the point in wrapping an ES into a Future?
  • 1
    @netikras Oh bugger me, that makes no sense. Completely missed the point of that.

    Excuse me while I sleep off my embarrassment.
  • 0
    @IntrusionCM Nothing, I think they're a great addition (or will be, when they roll out.) Not sure I'd call them asynchronous though - they're more like very lightweight threads with negligible context switching overhead. In many cases they'll replace the need for asynchronous stuff in Java, but not all.
Add Comment