Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Oh, almost forgot we have a bunch of setIntervals periodically tinkering with the singleton too, because how the fuck could we possibly miss that one out
-
retoor51568hMake RPC great again! My application is only rpc trough websocket. It's wrapped in a way that you don't even know you're talking with remote service and has no maintenance. await rpc.* calls always dynamically the * function on the server, specific class. Rest / ws handing is for losers.
-
@retoor no, that's a normal meme cat I post puff only in comments, upon request. I don't have puff pics at hand as of right now, sadly
-
also rpc calls over ws is something I actually wanted to try for a while tbh
-
retoor51568h@IHateForALiving it works very easy. It sends {method:name, args:args, callId:client generated number that server responds to}. So, every time when you do call, you return an unresolved promise that will be added to a list. Message receive event check if the promise with that call I'd is in the list and resolve it. Very async for messages in between and it's very comfortable that you can wait with await rpc.* with that comfort. My async server is doing a lot of other things before it will respond to you anyways. But still respond very quick. One of the things the server is doing could be sending a different message to your websocket. That's why an client side I'd is so important to communicate and attach to promise to resolve.. In my app it's very common to not receive the expected answer first but other ones.
-
@IHateForALiving I will second @retoor's WS RPC being amazing, having implemented a client from scratch in node/deno.
Also let me guess the PM was the one who wrote that code originally/senior who left -
retoor51567h@IHateForALiving oh, and function signature is fn(...args) so it can match the variable amount of arguments matching the rpc function defined in server.
https://developer.mozilla.org/en-US...
Maybe you already know all this shit, but it is really perfect and sadly see it nowhere. I didn't stole it from somewhere. It was just common sense. It's only finding out the proxy object that that was some luck tho. Many don't know that one.
But in general my js knowledge is very outdated. -
Time to break into that house with the broken window, shit a huge turd on the floor and run out while ducking.
Ask b2plane for diet advice for best results. -
@retoor You're more up to date than you think, knowing how to implement custom web components or the difference between function() {} and () => {} is not that common ❤️
-
@BordedDev hmm, js "devs" still believe they have invented first class functions?
-
@Lensflare I'm sure a lot still think it was the first to invent classes/prototypes (and don't realise how much sugar is in that language)
-
retoor51566h@BordedDev i kinda liked the function 'classes'. I wrote such huge projects in JS with ExtJS creating 'classes' like that when still no one was doing it. It was not normal to invest so much energy in JS at all. During that time, everyone was at tops doing mootools and jquery. Adding some validation or a clock. We wrote real desktop look and feel apps.
BTW! Never do that! Our application had double click events and stuff, people don't understand that in browser. -
@retoor I can imagine that's a bit strange for people, but that was also a bit of a trend for a while right, trying to mimic desktop style. I've been required to use an old system, and very much makes me think so.
I did a bit of jquery, mainly for the `$` but otherwise not much - must have been an interesting time. Java was what I was doing stuff in back then
> PM barges in
> "Have a ticket"
> something breaks in some subprocess at the core of the application
> the subprocess is some deeply intertwined, untested, undocumented, 80 files; all of them write on a globally accessible singleton with a complex system of events and RPC calls
> refuses to elaborate further
> leaves
rant