SlideShare a Scribd company logo
Tutorial - 6
• Revision of yesterday lecture
• Create a mini project of a simple calculator
• Create a mini project of todo lis
• What is JSON
• Event loop
• Event loop examples
• callback-queue
• API
• async calls
• setTimeout
• fetch
• Promise
Event loop
• Any execution happening in JS is taken care of by its
property of being "single threaded synchronous
language"
• And in order to achieve that we have Execution
Context
• But sometimes we have scenarios of handling the
call back functions or promises where the
behaviour of EC is not regular in order to maintain
JS core value of single threaded + sync. language
• Just to achieve that we have something called Event
loop
• Lets look into the pictorial way where is location of JS
• Just to highlight one thing that browser instead of
just executing the JS code on client side it has many
other powers also and those powers are called as
Web API, like:
Example one
Example - 2
Example - 3
• Call back queue is formed by the call backs
• Micro task ques are formed by Promises &
mutation requestes on DOM
• Micro task queue has higher priority then call
back queue
• They both are entertained by event loop
existing between the call-stack and subsequent
queuing system
• Because of higher priority of micro tasks
queue over call back queue, it may sometime
may take really long for micro tasks queue to
finished hence it creates a "STARVATION"
situation in for call back queue
• https://www.youtube.com/watch?v=8aGhZQkoFbQ
API - Application programming Interface
• Application:
⚬ A call as a template (interface) to perform any operation is
called as API
• Programming:
⚬ API call is related to any particular operation or a
particular program
• Interface:
⚬ These calls are related to any particular endpoint with any
particular predefined template
Types of API: There are 2 major kinds of APIs now days
in market - REST API & GraphQL
• REST are bit heavy and have separate endpoints for
separate operation
• GraphQL is super lite and has only 1 endpoint called
"graphql"
• https://www.youtube.com/watch?v=PeAOEAmR0D0
Callback functions
• A function getting called up by another
function is called as call back function
Asynchronous calls
AJAX
AJAX uses XHR requests i.e. XMLHttpRequest
Promises
Different ways to handle the asynchronous calls
async-await
fetch-then

More Related Content

What's hot

Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
olegshpynov
 
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, GigyaActors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Codemotion Tel Aviv
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
Huy Do
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
Barry Jones
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
Marcus Denker
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
Actor model : A Different Concurrency Approach
Actor model : A Different Concurrency ApproachActor model : A Different Concurrency Approach
Actor model : A Different Concurrency Approach
Emre Akış
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
Yung-Lin Ho
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvm
NLJUG
 
Frozen rails 2012 - Fighting Code Smells
Frozen rails 2012 - Fighting Code SmellsFrozen rails 2012 - Fighting Code Smells
Frozen rails 2012 - Fighting Code Smells
Dennis Ushakov
 
RubyMotion #jbday
RubyMotion #jbdayRubyMotion #jbday
RubyMotion #jbday
Dennis Ushakov
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
nohuhu
 
Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in Clojure
Troy Miles
 
Perl On The JVM (London.pm Talk 2009-04)
Perl On The JVM (London.pm Talk 2009-04)Perl On The JVM (London.pm Talk 2009-04)
Perl On The JVM (London.pm Talk 2009-04)
Ben Evans
 
Java Closures
Java ClosuresJava Closures
Java Closures
Ben Evans
 
Scala.io
Scala.ioScala.io
Scala.io
Diego Pacheco
 
JAVA 8 Parallel Stream
JAVA 8 Parallel StreamJAVA 8 Parallel Stream
JAVA 8 Parallel Stream
Tengwen Wang
 
Java 8 parallel stream
Java 8 parallel streamJava 8 parallel stream
Java 8 parallel stream
Yung Chieh Tsai
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
Tamas Rev
 

What's hot (19)

Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, GigyaActors and Microservices - Can two walk together? - Rotem Hermon, Gigya
Actors and Microservices - Can two walk together? - Rotem Hermon, Gigya
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
 
Reflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond SmalltakReflection in Pharo: Beyond Smalltak
Reflection in Pharo: Beyond Smalltak
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
Actor model : A Different Concurrency Approach
Actor model : A Different Concurrency ApproachActor model : A Different Concurrency Approach
Actor model : A Different Concurrency Approach
 
Introduction to Actor Model and Akka
Introduction to Actor Model and AkkaIntroduction to Actor Model and Akka
Introduction to Actor Model and Akka
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvm
 
Frozen rails 2012 - Fighting Code Smells
Frozen rails 2012 - Fighting Code SmellsFrozen rails 2012 - Fighting Code Smells
Frozen rails 2012 - Fighting Code Smells
 
RubyMotion #jbday
RubyMotion #jbdayRubyMotion #jbday
RubyMotion #jbday
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
 
Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in Clojure
 
Perl On The JVM (London.pm Talk 2009-04)
Perl On The JVM (London.pm Talk 2009-04)Perl On The JVM (London.pm Talk 2009-04)
Perl On The JVM (London.pm Talk 2009-04)
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
Scala.io
Scala.ioScala.io
Scala.io
 
JAVA 8 Parallel Stream
JAVA 8 Parallel StreamJAVA 8 Parallel Stream
JAVA 8 Parallel Stream
 
Java 8 parallel stream
Java 8 parallel streamJava 8 parallel stream
Java 8 parallel stream
 
Aspect j introduction for non-programmers
Aspect j introduction for non-programmersAspect j introduction for non-programmers
Aspect j introduction for non-programmers
 

Similar to Web development basics (Part-5)

JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
Saai Vignesh P
 
Plataforma distribuída de Microserviços ou, como a Olist funciona
Plataforma distribuída de Microserviços ou, como a Olist funcionaPlataforma distribuída de Microserviços ou, como a Olist funciona
Plataforma distribuída de Microserviços ou, como a Olist funciona
Osvaldo Santana Neto
 
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & ProvidersDEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
Cisco DevNet
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
Eduards Sizovs
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
Ron Perlmuter
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Serverless design with Fn project
Serverless design with Fn projectServerless design with Fn project
Serverless design with Fn project
Siva Rama Krishna Chunduru
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
Kasun Indrasiri
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
Toru Kawamura
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
Gary Yeh
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
ssuser35fdf2
 
EventMachine
EventMachineEventMachine
EventMachine
Stoyan Zhekov
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
Ruben Tan
 
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Lucas Jellema
 
No Compromise - Better, Stronger, Faster Java in the Cloud
No Compromise - Better, Stronger, Faster Java in the CloudNo Compromise - Better, Stronger, Faster Java in the Cloud
No Compromise - Better, Stronger, Faster Java in the Cloud
All Things Open
 
Микросервисы со Spring Boot & Spring Cloud
Микросервисы со Spring Boot & Spring CloudМикросервисы со Spring Boot & Spring Cloud
Микросервисы со Spring Boot & Spring Cloud
Vitebsk DSC
 
Node js internal
Node js internalNode js internal
Node js internal
Chinh Ngo Nguyen
 
Olist Architecture v2.0
Olist Architecture v2.0Olist Architecture v2.0
Olist Architecture v2.0
Osvaldo Santana Neto
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
Nitin Gupta
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
Ganesh Kondal
 

Similar to Web development basics (Part-5) (20)

JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
 
Plataforma distribuída de Microserviços ou, como a Olist funciona
Plataforma distribuída de Microserviços ou, como a Olist funcionaPlataforma distribuída de Microserviços ou, como a Olist funciona
Plataforma distribuída de Microserviços ou, como a Olist funciona
 
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & ProvidersDEVNET-1128	Cisco Intercloud Fabric NB Api's for Business & Providers
DEVNET-1128 Cisco Intercloud Fabric NB Api's for Business & Providers
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
Node.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel AvivNode.js meetup at Palo Alto Networks Tel Aviv
Node.js meetup at Palo Alto Networks Tel Aviv
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Serverless design with Fn project
Serverless design with Fn projectServerless design with Fn project
Serverless design with Fn project
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
Web Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the futureWeb Clients for Ruby and What they should be in the future
Web Clients for Ruby and What they should be in the future
 
Basic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.jsBasic Understanding and Implement of Node.js
Basic Understanding and Implement of Node.js
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
 
EventMachine
EventMachineEventMachine
EventMachine
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)Oracle Cloud Native Application Development (Meetup, 20th January 2020)
Oracle Cloud Native Application Development (Meetup, 20th January 2020)
 
No Compromise - Better, Stronger, Faster Java in the Cloud
No Compromise - Better, Stronger, Faster Java in the CloudNo Compromise - Better, Stronger, Faster Java in the Cloud
No Compromise - Better, Stronger, Faster Java in the Cloud
 
Микросервисы со Spring Boot & Spring Cloud
Микросервисы со Spring Boot & Spring CloudМикросервисы со Spring Boot & Spring Cloud
Микросервисы со Spring Boot & Spring Cloud
 
Node js internal
Node js internalNode js internal
Node js internal
 
Olist Architecture v2.0
Olist Architecture v2.0Olist Architecture v2.0
Olist Architecture v2.0
 
Evented Ruby VS Node.js
Evented Ruby VS Node.jsEvented Ruby VS Node.js
Evented Ruby VS Node.js
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 

Recently uploaded

Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 

Recently uploaded (20)

Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 

Web development basics (Part-5)

  • 1. Tutorial - 6 • Revision of yesterday lecture • Create a mini project of a simple calculator • Create a mini project of todo lis • What is JSON • Event loop • Event loop examples • callback-queue • API • async calls • setTimeout • fetch • Promise
  • 2. Event loop • Any execution happening in JS is taken care of by its property of being "single threaded synchronous language" • And in order to achieve that we have Execution Context • But sometimes we have scenarios of handling the call back functions or promises where the behaviour of EC is not regular in order to maintain JS core value of single threaded + sync. language
  • 3. • Just to achieve that we have something called Event loop • Lets look into the pictorial way where is location of JS
  • 4. • Just to highlight one thing that browser instead of just executing the JS code on client side it has many other powers also and those powers are called as Web API, like:
  • 8. • Call back queue is formed by the call backs • Micro task ques are formed by Promises & mutation requestes on DOM • Micro task queue has higher priority then call back queue • They both are entertained by event loop existing between the call-stack and subsequent queuing system
  • 9. • Because of higher priority of micro tasks queue over call back queue, it may sometime may take really long for micro tasks queue to finished hence it creates a "STARVATION" situation in for call back queue • https://www.youtube.com/watch?v=8aGhZQkoFbQ
  • 10. API - Application programming Interface • Application: ⚬ A call as a template (interface) to perform any operation is called as API • Programming: ⚬ API call is related to any particular operation or a particular program • Interface: ⚬ These calls are related to any particular endpoint with any particular predefined template
  • 11.
  • 12. Types of API: There are 2 major kinds of APIs now days in market - REST API & GraphQL • REST are bit heavy and have separate endpoints for separate operation • GraphQL is super lite and has only 1 endpoint called "graphql"
  • 14. Callback functions • A function getting called up by another function is called as call back function
  • 16.
  • 17. AJAX AJAX uses XHR requests i.e. XMLHttpRequest
  • 19.
  • 20. Different ways to handle the asynchronous calls async-await