SelvesanIntroductionIntroductionContact ↗Contact ↗ (opens in a new tab)
GitHubGitHub (opens in a new tab)DiscordDiscord (opens in a new tab)
  • Introduction
  • Node JS
    • Event Loop
    • Security
    • Stream
  • AWS
    • VPC & Subnet
    • Auto Scaling
  • AI
    • LLM
      • Langchain
      • Rag
    • Machine Learning
      • Python and Venv
      • Python Fundamentals
  • Database
    • Install Postgres (CentOs)
    • Install POSTGIS
    • Database Caching (Redis)
    • RDS and EC2
    • Only Postgres
  • Docker
    • Fundamentals
    • Docker & EC2
    • Kubernetes Overview
  • Github
    • Package Registry
  • DevOps
    • Terraform
  • Javascript
    • Schedular API
    • Call Apply Bind
    • Decorators
  • Monorepo
  • Another
  • Introduction
  • Node JS
    • Event Loop
    • Security
    • Stream
  • AWS
    • VPC & Subnet
    • Auto Scaling
  • AI
    • LLM
      • Langchain
      • Rag
    • Machine Learning
      • Python and Venv
      • Python Fundamentals
  • Database
    • Install Postgres (CentOs)
    • Install POSTGIS
    • Database Caching (Redis)
    • RDS and EC2
    • Only Postgres
  • Docker
    • Fundamentals
    • Docker & EC2
    • Kubernetes Overview
  • Github
    • Package Registry
  • DevOps
    • Terraform
  • Javascript
    • Schedular API
    • Call Apply Bind
    • Decorators
  • Introduction
  • Monorepo
  • Contact ↗ (opens in a new tab)
  • Another
Question? Give us feedback → (opens in a new tab)Edit this page
Javascript
Schedular API

Schedular API

The browser does not support setImmediate method which helps us to chunk the codes(taking the long task that is breaking the main thread into smaller pieces by which the main thread can perform operations between those chunks).

Since this isn't available in browser we overcome this issue with the use of schedular API.

 
function blockingExample () {
    console.time('blocking task');
 
    let sum = 0;
    for (let i = 0; i < 10000000000, i++) {
        sum += i;
    }
    console.timeEnd('blocking complete');
    console.log(sum);
}
 
blockingExample();
 
TerraformCall Apply Bind

Simulation in a suspended dust