[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>Event driven programming

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 34
Thread images: 6

File: yandex.jpg (3KB, 153x123px) Image search: [Google]
yandex.jpg
3KB, 153x123px
>Event driven programming
>>
>>59167242
>Brainless sheep frogposters
>>
No, you're right, let's keep everything in a single thread and freeze up while waiting for input.
Or better yet, check for input 100000 times per second and keep waking the CPU for no good reason.
>>
>>59167317
frogposter > autism poster
>>
>>59167329
fuck off to ur js ,shithead
>>
>>59167338

those aren't mutually exclusive terms, anon
>>
>>59167338
frogposter == autism poster
Don't kid yourself OP, your denial tells all.
>>
File: wqcccccas.jpg (9KB, 228x221px) Image search: [Google]
wqcccccas.jpg
9KB, 228x221px
>>59167372
>>59167382
i have a gf and all
>>
File: gondola.jpg (45KB, 400x400px) Image search: [Google]
gondola.jpg
45KB, 400x400px
>>59167329
/thread
>>
>>59167409
So you need a woman to validate your life? That's really fucking sad actually.
>>
>>59167467
>>59167329
are you guys fucking stupid?

in an event based programming you wait for the event to fire
>>
>>59167532
How do you know when events fire?
You have to check for them, dumbass.
>>
>>59167549
actually OP is right , they are bad

http://cgi.di.uoa.gr/~mema/courses/mde518/papers/vonbehren.pdf
>>
All "event-driven" programming does is defer event polling from the programmer to a framework that may or may not do it efficiently.

It's like manual memory allocation vs garbage collection.
>>
>>59167549
hardware interrupts
>>
>>59167621
>implying that manual memory allocations isn't bad
>>
>>59167369

await a()
await b()
await c()
await d()
await e()
const resultsFromF = await f()
console.log(resultsFromF)
>>
>>59167681
Wouldn't that mean that a b c d & e can all run concurrently, when that is isn't true?
>>
>>59167382
did you just use the fucking comparrison operator
>>
>>59167625
And what does the interruption do ? Set a variable that the main program checks every so often ?
How does that solve anything ?
>>
>>59167750
Yeah, do you have a problem with that, sperglord?
>>
>>59167715
No, the await keyword is used to
wait for an asynchronous event to finish without blocking the event loop.

It is built on-top of es2015 Promises.
>>
>>59167809
>>>
t.autism pajeet monkey
>>
>>59167828
I don't get it.
>>
>>59167839
Please explain how that makes sense. It doesn't.
>>
>>59167861
is "which is finishing first"
>>
>>59167771
Pretty sure it tells the OS to call callbacks.
It's better if the kernel does the polling than when the user software does it, because the kernel still can switch off unused ressources, unlike a polling software which drains your laptops batteries.
>>
>>59167861
It blocks the calling thread to wait for an asynchronous function to finish so that every asynchronous function gets executed in order. Much easier and clearer to implement in comparison to promises and callbacks in my opinion. Javascript needed this for a long time.
>>
>>59168010
Thanks, I get it now.
>>
>>59167242
it's better than
objectGeneratorGeneratorHandleCreator()
>>
>>59167549
>You have to check for them, dumbass.

No, you don't have to check for them. The framework checks for them. And the framework is smart enough not to use polling loops or blocking I/O.
>>
who here /event-drivenObjective-orientedFunctionalImperativeProgramming/
>>
File: rx.png (18KB, 767x356px) Image search: [Google]
rx.png
18KB, 767x356px
>Event driven programming
Is awesome.
>>
>>59168353
How do you check for events without spawning threads for polling loops with mutexes for blocking I/O?
Thread posts: 34
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.