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
-
killames5703y@galileopy well technically the callee returns a promise
The caller is an async function being awaited by the express async event handler -
john-doe9363y@killames why do you have an async express handler? Express is explicitly a continuation passing stack.
-
killames5703y@galileopy if I’m remembering
It’s the way it was laid out in example code and it’s the only way I can use await -
john-doe9363y@killames well, if something gets stuck in await it can be.
1. An uncaught exception. Passing straight to the catch
2. The callee is returning a promise that never resolves, say you have 2 promises in callee one resolves the other didn't, and callee is returning the one that didn't.
And that's pretty much it. -
john-doe9363yAlso, example code from the webs is full of bugs, better to understand the concept than to try modify an example written by a rando.
-
killames5703y@galileopy well I hadn’t worked with async crap previously
This code works until the server bug says an asset doesn’t exist once too often heh -
john-doe9363y@killames you asked how can code get stuck on an await call. Another possible reason is a breakpoint. That one is the funniest one, because it can only happen when you're debugging.
-
killames5703y@galileopy well that’s not where it was always happening
Personally I think promise code is kind of worthless
Async should be done on threads -
god i hate node js and its lack of defined threading ! it makes the code so goddamned messy and you can't even expect that event handlers will return on the same thread so you end up with spaghetti code from hell if you use async functionality as it appears !
-
sounds like you're trying to make js behave like a real programming language. tisk tisk poor you.
-
john-doe9363yIt's odd how you guys can get tangled with Node.js it is the most beautiful language used in the mainstream. The thing I love most about it, is that you can use powerful functional patterns without a compiler or typesystem code-blocking you.
-
killames5703y@galileopy to wrote spaghetti code unless you force everything to be synchronous or write everything like a processing queue
-
john-doe9363y@killames Yo don't need to write everything to be sync. Or write spaghetti. Nose surely has a learning curve, that is, if you want to write good Node code.
-
killames5703y@galileopy yes but this seems like a failure which really it kind of is
Like I know how I might have go speed a certain part of my code
Which would be to add a status field to a list of global records that indicate which of several timer calls should pick it up and do something to it
That’s ridiculous
When I could write one thread and just spawn several copies that report their progress and one controller thread that either cancels a frozen one or starts a new one when one finishes -
killames5703y@galileopy I’d still have to manually wrap things in promises or specifically call sync methods is the problem so it just doesn’t seem like that is really the answer at this point lol
I mean holy shit everything requires a callback or uses a promise so it’s all async by default and they have worker threads lol what a ducking mess of a language lol -
killames5703y@galileopy the answer seems to be to design globally exposed datasets and the like and multiple timer events that do what I said which would like simply the code considerably because you could just use the stupid callbacks and all the asyncs heh
-
john-doe9363yOhh, I didn't realize you just wanted to troll. Be my guest, yeah, node sucks. Java FTW. C# rocks. Who needs single threaded event loops anyways.
-
killames5703y@galileopy not trolling
Node is a terrible idea
It’s a terrible implementation
C# isn’t a bad language
But I’ve been writing things in a node and I’m discovering all its little gotchas
It’s not a complete development kit
It’s a niche development kit
It has specific uses and those uses so far as I can tell are mostly to perform simple quick tasks and return a result
What I’m writing now could have been accomplished much quicker in other languages so I’m discovering it’s quirks rather rapidly
And then there is the reliance on 3rd party modules which either function
Strangely or don’t function at all and we had this conversation already
Related Rants
Anyone ever seen the behavior with async methods and promises where at the end of what should finish the await in the calling code the function never progresses past the await even though it returned ?
question
node js