I am understanding how the js engine handles promises then I got this great article https://medium.com/@jitubutwal144/javascript-how-is-callback-execution-strategy-for-promises-different-than-dom-events-callback-73c0e9e203b1. This made me very much clear. But If we make an HTTP request inside the promise then when js see that promise object which contains Http request it adds its callback in the microtask queue and js call stack starts executing promise. It saw HTTP request and send's it to browser to make it. Now the browser is completed with it and add's http callback to task queue which calls resolve, request. According to its js engine first picks micro task but it cannot do anything with a microtask because its resultant callback is in the task queue. I am confused about how the js engine will handle it. Can anyone please help
How javascript callstack, queue handles http request inside promise
90 Views Asked by Geetanshu Gulati At
0
There are 0 best solutions below
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in PROMISE
- why promise returns an unexpected output for nested promises?
- How to make promises execute in order?
- why when I resolve a promise, the output is in pending state?
- why throw inside of an setTimeout, located inside a promise, doesn't change state and result of the output promise?
- Fetch file, read contents and return contents all in one function
- why promise has a weird precedence for errors in js?
- How does nesting of promises work in javascipt
- How can I break the for loop within the then block?
- Wait set state finishes to call another function
- Why do JavaScript multiple async/awaits behave differently when it awaits promises vs when it awaits functions returning promises?
- How to do computation in parallel with an S3 Node sdk call to server
- Second useState doesn't update in promise chain
- Why can't I get a result from the Office.context.mailbox.item.to.getAsync function?
- Type return value of function to be an array of the return values of input array of functions
- angular test inside subscribe of modal
Related Questions in QJSENGINE
- QJSValue call Array.prototype.push not working
- QJSEngine does not know how to handle Qt basic types
- C++ QT Call C++ function in QJSEngine
- Register inherited QObject's meta object to QJSEngine
- Is it valid to call QJSEngine::newQObject() in a C++ function called by a script?
- Can I retain ownership of QObjects passed to QJSEngine?
- Register custom type in Qt with QJsEngine
- QJSEngine - exposing classes and throwing errors
- QJSEngine, global and script, what is causing the syntax error
- Does using QJSEngine have security implications for my application?
- How to register an enum type to QJSEngine to be used from the scripting environment?
- How javascript callstack, queue handles http request inside promise
- How to register types like QList<quint64> in QJSEngine?
- How to expose enum not owned by QObject to QJSEngine?
- With deprecation of QScriptEngine, how do we port the QScriptClass-related code?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?