SetImmediate SetTimeout and Process.nextTick | Backend Interview Series

  Рет қаралды 14,940

Pepcoding

Pepcoding

Күн бұрын

Пікірлер
@Pepcoding
@Pepcoding 3 жыл бұрын
🚨 Backend Development: kzbin.info/aero/PL-Jc9J83PIiEnK1q9tuVrrORqKBexcE_J
@parthvaishnani2205
@parthvaishnani2205 11 күн бұрын
Preferrance order for execution- Nexttick > SetImmediate > Settimeout
@yashbansal2526
@yashbansal2526 Жыл бұрын
Whatever you. have taught about priority is wrong, please correct it, anyone watching this please don't get confuse and do a simple google search
@shubhamsoni6013
@shubhamsoni6013 Жыл бұрын
Checked the same on Apple Mac, 1.4 GHz Quad-Core Intel Core i5, 16 GB 2133 MHz LPDDR3, Intel Iris Plus Graphics 645 1536 MB index.ts setTimeout(function(){ console.log("Settimeout") }) setImmediate(function(){ console.log("Setimmediate") }) command: npx ts-node index.ts result: Setimmediate Settimeout & sometime reverse. So as per my opinion, you would be never knowing which callback function will be called first until you know in which phase your event loop is. Thread is open for comments. Floor is yours!!
@dharmeast
@dharmeast 3 жыл бұрын
But we add some time say 1000 in setTimeOut , then setImmediate will be called first.
@sachinyadav-of4wh
@sachinyadav-of4wh 2 жыл бұрын
what we are not using SetTimeout and setImmediate in the I/O phase it is not necessary that settimeout will call first. It all depends on system's current operations. anything setimmediate/SetTimeout can be called first.
@sarojjangid8466
@sarojjangid8466 2 жыл бұрын
Nice sir ♥️
@rishu605
@rishu605 2 жыл бұрын
Whatever you have explained related to setImmediate and setTimeout priorities is completely wrong. setImmediate has a higher priority than setTimeout when it is running in an I/O cycle. Since you are running this code outside of an I/O cycle, the order of executon is NOT guaranteed and the system can execute any callback first.
@abbasraza7086
@abbasraza7086 2 жыл бұрын
absolutely
Child Process Module in Node JS | Backend Interview Series
6:28
Node Js Interview Questions | Backend Interview Series
19:13
Pepcoding
Рет қаралды 44 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
Streams in Node Js | Backend Interview Series
17:48
Pepcoding
Рет қаралды 12 М.
NodeJs Interview | NodeJs Interview Questions | NodeJs Questions
40:33
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 667 М.
How to create a child process in nodejs (exec, execFile and spawn)
13:39
setImmediate and process.nextTick
4:11
Zain Ejaz
Рет қаралды 13 М.
Node.js Tutorial - 42 - Event Loop
14:21
Codevolution
Рет қаралды 134 М.