SlideShare a Scribd company logo
Web Workers
JAGADEESH PATTA( PJ )
Agenda
 Introduction
 Steps to create service worker.
Introduction
 Web workers are scripts that are runs in background threads.
 Web worker thread perform tasks without interfering UI
thread.
 Web workers can perform I/O operations using
XMLHttpRequest.
Introduction(cont…)
 Web workers can communicate with UI thread using event
messages.

Recommended for you

METEOR 101
METEOR 101METEOR 101
METEOR 101

This document discusses Meteor, a JavaScript web framework. It provides an overview of Meteor's features like quick development time, isomorphic code, and live updates. It then outlines an agenda to create a basic to-do list app in Meteor, including setting up the dev environment, creating templates and collections, adding forms, and account systems. The document ends with resources for learning more about Meteor.

meteorjavascript
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await

Understanding of asynchronous model is an essential knowledge for development of quality Windows Store apps. This session dives deep into implementation details of async and await C# keywords and provides information about common pitfalls and mistakes of async pattern use and the ways to avoid them.

From zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScriptFrom zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScript

From zero to hero with the reactive extensions for JavaScript at the Munich Web Developer Conference 2017. http://www.web-developer-conference.de

wdcrxjsjavascript
Steps to create web worker
 Create web worker file
 Create object for web worker
 Communication with Web Worker
 Terminate web worker
Create web worker file
Step-1:
Check weather the browser supports the web workers or not.
If ( typeof Worker !== “undefined” ) {
// Your browser supports web workers
} else {
// Your browser not supporting web workers.
}
Create web worker file(cont…)
Step-2(web-worker-name.js):
var count = 0;
function getCount(){
count = count + 1;
postMessage(count);
setTimeout(“getCount()”, 1000);
}
getCount();
Create Object for web worker
 Web worker file and current JavaScript code must be comes
under same origin.
 Check existence of web worker object.
If ( typeof workerObj == “undefined” ) {
workerObj = new Worker(“web-worker-name.js”);
}

Recommended for you

Inspiring conference - Automation & external service integration
Inspiring conference -  Automation & external service integrationInspiring conference -  Automation & external service integration
Inspiring conference - Automation & external service integration

How to integrate external service in your Neos CMS & Flow Framework project. Mostly valid for any kind of project.

integrationphpneoscms
2310 b 05
2310 b 052310 b 05
2310 b 05

The document provides an overview of adding code to Microsoft ASP.NET web forms. It discusses using code-behind pages, adding event procedures to web server controls, and using page events. Specific topics covered include implementing code using different methods, writing inline code, understanding code-behind pages, creating event procedures, interacting with controls in events, and the page event life cycle.

Scott Guthrie at Dot Net Startup meetup
Scott Guthrie at Dot Net Startup meetupScott Guthrie at Dot Net Startup meetup
Scott Guthrie at Dot Net Startup meetup

Scott Guthrie slides talking about what's new on VS 11, .NET 4.5 and MVC 4, including automatic Bundling, Minifying, Real Time updates, SignalR, Asynchronous requests, Web API, Database Migration and Open Source of MVC / ASP.NET.

signalr.net frameworkmvc4
Communication with Web Worker
 The communication between web worker and UI thread done by
event messages.
 Send / Receive data using postMessage and onmessage
methods.
Step-1(send data from web worker):
postMessage(“content needs to be send”);
Communication(cont…)
Step-2(Receive data from web worker):
workerObj.onmessage = function(event){
var element = document.getElementById(‘id’);
element.innerHTML = event.data;
}
Terminating web worker
 check weather the workerObj is undefined or not.
if ( typeof workerObj !== “undefined” ) {
workerObj.terminate();
}
Questions ?

Recommended for you

iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4

This document provides an overview of lessons for building an iOS app, including a lesson on data modeling. It describes how to create a storyboard to visually represent the user interface with scenes and views. It explains how view controllers manage views and navigation between screens. It also shows code for creating, editing, displaying and deleting notes data using a data model to manage the data and share it between view controllers.

ios (apple)
[SoftServe IT Academy] - JavaScript Events
[SoftServe IT Academy] -  JavaScript Events[SoftServe IT Academy] -  JavaScript Events
[SoftServe IT Academy] - JavaScript Events

This document discusses JavaScript events. It covers types of events like onclick and onmouseover. It describes how to register event handlers by setting attributes or properties. It discusses the event handler argument and how to cancel events. It also explains event bubbling and capturing, where events triggered on nested elements will trigger from the innermost to outermost elements or vice versa.

javascript
Web Os Hands On
Web Os Hands OnWeb Os Hands On
Web Os Hands On

The document summarizes building a webOS application from scratch using Agile Commerce. It discusses generating the initial project structure, adding logging, generating scenes, building and populating a list with data from a REST service, and adding an image viewing widget to scroll through images. Key files and functions are explained for each step in developing the application.

insidemobilewebosmojosdk
Thank You

More Related Content

What's hot

jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
Pooja Saxena
 
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-appsJSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
Mukul Jain
 
Lec 5
Lec 5Lec 5
METEOR 101
METEOR 101METEOR 101
METEOR 101
Tin Aung Lin
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await
Andrei Marukovich
 
From zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScriptFrom zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
Inspiring conference - Automation & external service integration
Inspiring conference -  Automation & external service integrationInspiring conference -  Automation & external service integration
Inspiring conference - Automation & external service integration
dfeyer
 
2310 b 05
2310 b 052310 b 05
2310 b 05
Krazy Koder
 
Scott Guthrie at Dot Net Startup meetup
Scott Guthrie at Dot Net Startup meetupScott Guthrie at Dot Net Startup meetup
Scott Guthrie at Dot Net Startup meetup
Marcelo Calbucci
 
iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4
Calvin Cheng
 
[SoftServe IT Academy] - JavaScript Events
[SoftServe IT Academy] -  JavaScript Events[SoftServe IT Academy] -  JavaScript Events
[SoftServe IT Academy] - JavaScript Events
Ivan Matiishyn
 
Web Os Hands On
Web Os Hands OnWeb Os Hands On
Web Os Hands On
360|Conferences
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
Duy Khanh
 
Reactive Programming in the Browser feat. Scala.js and Rx
Reactive Programming in the Browser feat. Scala.js and RxReactive Programming in the Browser feat. Scala.js and Rx
Reactive Programming in the Browser feat. Scala.js and Rx
Luka Jacobowitz
 
Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
Kamil Augustynowicz
 
Ember.js for Big Profit
Ember.js for Big ProfitEmber.js for Big Profit
Ember.js for Big Profit
CodeCore
 

What's hot (16)

jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
 
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-appsJSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
JSChannel 2017 - Service Workers and the Role they Play in modern day web-apps
 
Lec 5
Lec 5Lec 5
Lec 5
 
METEOR 101
METEOR 101METEOR 101
METEOR 101
 
Deceptive simplicity of async and await
Deceptive simplicity of async and awaitDeceptive simplicity of async and await
Deceptive simplicity of async and await
 
From zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScriptFrom zero to hero with the reactive extensions for JavaScript
From zero to hero with the reactive extensions for JavaScript
 
Inspiring conference - Automation & external service integration
Inspiring conference -  Automation & external service integrationInspiring conference -  Automation & external service integration
Inspiring conference - Automation & external service integration
 
2310 b 05
2310 b 052310 b 05
2310 b 05
 
Scott Guthrie at Dot Net Startup meetup
Scott Guthrie at Dot Net Startup meetupScott Guthrie at Dot Net Startup meetup
Scott Guthrie at Dot Net Startup meetup
 
iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4
 
[SoftServe IT Academy] - JavaScript Events
[SoftServe IT Academy] -  JavaScript Events[SoftServe IT Academy] -  JavaScript Events
[SoftServe IT Academy] - JavaScript Events
 
Web Os Hands On
Web Os Hands OnWeb Os Hands On
Web Os Hands On
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Reactive Programming in the Browser feat. Scala.js and Rx
Reactive Programming in the Browser feat. Scala.js and RxReactive Programming in the Browser feat. Scala.js and Rx
Reactive Programming in the Browser feat. Scala.js and Rx
 
Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
 
Ember.js for Big Profit
Ember.js for Big ProfitEmber.js for Big Profit
Ember.js for Big Profit
 

Similar to Web workers | JavaScript | HTML API

Beyond HTML: Tools for Building Web 2.0 Apps
Beyond HTML: Tools for Building Web 2.0 AppsBeyond HTML: Tools for Building Web 2.0 Apps
Beyond HTML: Tools for Building Web 2.0 Apps
Marcos Caceres
 
webworkers
webworkerswebworkers
webworkers
Asanka Indrajith
 
JavaScript Web Workers
JavaScript Web WorkersJavaScript Web Workers
JavaScript Web Workers
Tobias Pfeiffer
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
Walid Ashraf
 
Responsive interfaces
Responsive interfacesResponsive interfaces
Responsive interfaces
Nicholas Zakas
 
Intro to jQuery @ Startup Institute
Intro to jQuery @ Startup InstituteIntro to jQuery @ Startup Institute
Intro to jQuery @ Startup Institute
Rafael Gonzaque
 
JavaScript Libraries
JavaScript LibrariesJavaScript Libraries
JavaScript Libraries
Daminda Herath
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
Fajar Baskoro
 
Asp
AspAsp
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
Hoat Le
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
Julie Iskander
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
tutorialsruby
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
tutorialsruby
 
Qtp not just for gui anymore
Qtp   not just for gui anymoreQtp   not just for gui anymore
Qtp not just for gui anymore
Pragya Rastogi
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript Development
Tommy Vercety
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
imdurgesh
 
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
Parth Joshi
 
Ajax Lecture Notes
Ajax Lecture NotesAjax Lecture Notes
Ajax Lecture Notes
Santhiya Grace
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
Madhuri Kavade
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohan
WebVineet
 

Similar to Web workers | JavaScript | HTML API (20)

Beyond HTML: Tools for Building Web 2.0 Apps
Beyond HTML: Tools for Building Web 2.0 AppsBeyond HTML: Tools for Building Web 2.0 Apps
Beyond HTML: Tools for Building Web 2.0 Apps
 
webworkers
webworkerswebworkers
webworkers
 
JavaScript Web Workers
JavaScript Web WorkersJavaScript Web Workers
JavaScript Web Workers
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Responsive interfaces
Responsive interfacesResponsive interfaces
Responsive interfaces
 
Intro to jQuery @ Startup Institute
Intro to jQuery @ Startup InstituteIntro to jQuery @ Startup Institute
Intro to jQuery @ Startup Institute
 
JavaScript Libraries
JavaScript LibrariesJavaScript Libraries
JavaScript Libraries
 
1 ppt-ajax with-j_query
1 ppt-ajax with-j_query1 ppt-ajax with-j_query
1 ppt-ajax with-j_query
 
Asp
AspAsp
Asp
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
 
ajax_pdf
ajax_pdfajax_pdf
ajax_pdf
 
Qtp not just for gui anymore
Qtp   not just for gui anymoreQtp   not just for gui anymore
Qtp not just for gui anymore
 
01 Introduction - JavaScript Development
01 Introduction - JavaScript Development01 Introduction - JavaScript Development
01 Introduction - JavaScript Development
 
Asp.net By Durgesh Singh
Asp.net By Durgesh SinghAsp.net By Durgesh Singh
Asp.net By Durgesh Singh
 
Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
 
Ajax Lecture Notes
Ajax Lecture NotesAjax Lecture Notes
Ajax Lecture Notes
 
Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Ajax tutorial by bally chohan
Ajax tutorial by bally chohanAjax tutorial by bally chohan
Ajax tutorial by bally chohan
 

More from pcnmtutorials

12. Map | WeakMap | ES6 | JavaScript | Typescript
12. Map | WeakMap | ES6 | JavaScript | Typescript12. Map | WeakMap | ES6 | JavaScript | Typescript
12. Map | WeakMap | ES6 | JavaScript | Typescript
pcnmtutorials
 
11. Iterators | ES6 | JavaScript | TypeScript
11. Iterators | ES6 | JavaScript | TypeScript11. Iterators | ES6 | JavaScript | TypeScript
11. Iterators | ES6 | JavaScript | TypeScript
pcnmtutorials
 
10. symbols | ES6 | JavaScript | TypeScript
10. symbols | ES6 | JavaScript | TypeScript10. symbols | ES6 | JavaScript | TypeScript
10. symbols | ES6 | JavaScript | TypeScript
pcnmtutorials
 
9. ES6 | Let And Const | TypeScript | JavaScript
9. ES6 | Let And Const | TypeScript | JavaScript9. ES6 | Let And Const | TypeScript | JavaScript
9. ES6 | Let And Const | TypeScript | JavaScript
pcnmtutorials
 
8. Spread Syntax | ES6 | JavaScript
8. Spread Syntax | ES6 | JavaScript8. Spread Syntax | ES6 | JavaScript
8. Spread Syntax | ES6 | JavaScript
pcnmtutorials
 
7. Rest parameters | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript7. Rest parameters | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript
pcnmtutorials
 
6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript
pcnmtutorials
 
5. Destructuring | ES6 | Assignment
5. Destructuring | ES6 | Assignment 5. Destructuring | ES6 | Assignment
5. Destructuring | ES6 | Assignment
pcnmtutorials
 
4. Template strings | ES6
4. Template strings | ES64. Template strings | ES6
4. Template strings | ES6
pcnmtutorials
 
3. Object literals | ES6 | JSON
3. Object literals | ES6 | JSON3. Object literals | ES6 | JSON
3. Object literals | ES6 | JSON
pcnmtutorials
 
2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript
2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript
2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript
pcnmtutorials
 
1. Arrow Functions | JavaScript | ES6
1. Arrow Functions | JavaScript | ES61. Arrow Functions | JavaScript | ES6
1. Arrow Functions | JavaScript | ES6
pcnmtutorials
 
Decorators | TypeScript | Angular2 Decorators
Decorators | TypeScript | Angular2 DecoratorsDecorators | TypeScript | Angular2 Decorators
Decorators | TypeScript | Angular2 Decorators
pcnmtutorials
 
Declaration merging | Typescript
Declaration merging | TypescriptDeclaration merging | Typescript
Declaration merging | Typescript
pcnmtutorials
 
Module resolution | Typescript
Module resolution | TypescriptModule resolution | Typescript
Module resolution | Typescript
pcnmtutorials
 
Material design in android L developer Preview
Material design in android L developer PreviewMaterial design in android L developer Preview
Material design in android L developer Preview
pcnmtutorials
 
data structure, stack, stack data structure
data structure, stack, stack data structuredata structure, stack, stack data structure
data structure, stack, stack data structure
pcnmtutorials
 
1.introduction to data_structures
1.introduction to data_structures1.introduction to data_structures
1.introduction to data_structures
pcnmtutorials
 

More from pcnmtutorials (18)

12. Map | WeakMap | ES6 | JavaScript | Typescript
12. Map | WeakMap | ES6 | JavaScript | Typescript12. Map | WeakMap | ES6 | JavaScript | Typescript
12. Map | WeakMap | ES6 | JavaScript | Typescript
 
11. Iterators | ES6 | JavaScript | TypeScript
11. Iterators | ES6 | JavaScript | TypeScript11. Iterators | ES6 | JavaScript | TypeScript
11. Iterators | ES6 | JavaScript | TypeScript
 
10. symbols | ES6 | JavaScript | TypeScript
10. symbols | ES6 | JavaScript | TypeScript10. symbols | ES6 | JavaScript | TypeScript
10. symbols | ES6 | JavaScript | TypeScript
 
9. ES6 | Let And Const | TypeScript | JavaScript
9. ES6 | Let And Const | TypeScript | JavaScript9. ES6 | Let And Const | TypeScript | JavaScript
9. ES6 | Let And Const | TypeScript | JavaScript
 
8. Spread Syntax | ES6 | JavaScript
8. Spread Syntax | ES6 | JavaScript8. Spread Syntax | ES6 | JavaScript
8. Spread Syntax | ES6 | JavaScript
 
7. Rest parameters | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript7. Rest parameters | ES6 | JavaScript
7. Rest parameters | ES6 | JavaScript
 
6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript6. Default parameters | ES6 | JavaScript
6. Default parameters | ES6 | JavaScript
 
5. Destructuring | ES6 | Assignment
5. Destructuring | ES6 | Assignment 5. Destructuring | ES6 | Assignment
5. Destructuring | ES6 | Assignment
 
4. Template strings | ES6
4. Template strings | ES64. Template strings | ES6
4. Template strings | ES6
 
3. Object literals | ES6 | JSON
3. Object literals | ES6 | JSON3. Object literals | ES6 | JSON
3. Object literals | ES6 | JSON
 
2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript
2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript
2. Classes | Object Oriented Programming in JavaScript | ES6 | JavaScript
 
1. Arrow Functions | JavaScript | ES6
1. Arrow Functions | JavaScript | ES61. Arrow Functions | JavaScript | ES6
1. Arrow Functions | JavaScript | ES6
 
Decorators | TypeScript | Angular2 Decorators
Decorators | TypeScript | Angular2 DecoratorsDecorators | TypeScript | Angular2 Decorators
Decorators | TypeScript | Angular2 Decorators
 
Declaration merging | Typescript
Declaration merging | TypescriptDeclaration merging | Typescript
Declaration merging | Typescript
 
Module resolution | Typescript
Module resolution | TypescriptModule resolution | Typescript
Module resolution | Typescript
 
Material design in android L developer Preview
Material design in android L developer PreviewMaterial design in android L developer Preview
Material design in android L developer Preview
 
data structure, stack, stack data structure
data structure, stack, stack data structuredata structure, stack, stack data structure
data structure, stack, stack data structure
 
1.introduction to data_structures
1.introduction to data_structures1.introduction to data_structures
1.introduction to data_structures
 

Recently uploaded

Safe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work PermitsSafe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work Permits
sheqnetworkmarketing
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
ssuser2b426d1
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Asher Sterkin
 
How we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hoursHow we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hours
Ortus Solutions, Corp
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
sachin chaurasia
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
karim wahed
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
ThousandEyes
 
MVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptxMVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptx
Mitchell Marsh
 
Break data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud ConnectorsBreak data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud Connectors
confluent
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
sudsdeep
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
akshesh doshi
 
Overview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptxOverview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptx
Mitchell Marsh
 
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
Roshan Dwivedi
 
active-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptxactive-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptx
sudsdeep
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
miso_uam
 
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdf
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdfResponsibilities of Fleet Managers and How TrackoBit Can Assist.pdf
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdf
Trackobit
 
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

Safe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work PermitsSafe Work Permit Management Software for Hot Work Permits
Safe Work Permit Management Software for Hot Work Permits
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTIONBITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
BITCOIN HEIST RANSOMEWARE ATTACK PREDICTION
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
 
How we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hoursHow we built TryBoxLang in under 48 hours
How we built TryBoxLang in under 48 hours
 
introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...introduction of Ansys software and basic and advance knowledge of modelling s...
introduction of Ansys software and basic and advance knowledge of modelling s...
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) AWS Security .pdf
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
WEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service ProvidersWEBINAR SLIDES: CCX for Cloud Service Providers
WEBINAR SLIDES: CCX for Cloud Service Providers
 
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
 
MVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptxMVP Mobile Application - Codearrest.pptx
MVP Mobile Application - Codearrest.pptx
 
Break data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud ConnectorsBreak data silos with real-time connectivity using Confluent Cloud Connectors
Break data silos with real-time connectivity using Confluent Cloud Connectors
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
 
Overview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptxOverview of ERP - Mechlin Technologies.pptx
Overview of ERP - Mechlin Technologies.pptx
 
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
FAST Channels: Explosive Growth Forecast 2024-2027 (Buckle Up!)
 
active-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptxactive-directory-auditing-solution (2).pptx
active-directory-auditing-solution (2).pptx
 
Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)Software development... for all? (keynote at ICSOFT'2024)
Software development... for all? (keynote at ICSOFT'2024)
 
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdf
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdfResponsibilities of Fleet Managers and How TrackoBit Can Assist.pdf
Responsibilities of Fleet Managers and How TrackoBit Can Assist.pdf
 
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
Abortion pills in Fujairah *((+971588192166*)☎️)¥) **Effective Abortion Pills...
 

Web workers | JavaScript | HTML API

  • 2. Agenda  Introduction  Steps to create service worker.
  • 3. Introduction  Web workers are scripts that are runs in background threads.  Web worker thread perform tasks without interfering UI thread.  Web workers can perform I/O operations using XMLHttpRequest.
  • 4. Introduction(cont…)  Web workers can communicate with UI thread using event messages.
  • 5. Steps to create web worker  Create web worker file  Create object for web worker  Communication with Web Worker  Terminate web worker
  • 6. Create web worker file Step-1: Check weather the browser supports the web workers or not. If ( typeof Worker !== “undefined” ) { // Your browser supports web workers } else { // Your browser not supporting web workers. }
  • 7. Create web worker file(cont…) Step-2(web-worker-name.js): var count = 0; function getCount(){ count = count + 1; postMessage(count); setTimeout(“getCount()”, 1000); } getCount();
  • 8. Create Object for web worker  Web worker file and current JavaScript code must be comes under same origin.  Check existence of web worker object. If ( typeof workerObj == “undefined” ) { workerObj = new Worker(“web-worker-name.js”); }
  • 9. Communication with Web Worker  The communication between web worker and UI thread done by event messages.  Send / Receive data using postMessage and onmessage methods. Step-1(send data from web worker): postMessage(“content needs to be send”);
  • 10. Communication(cont…) Step-2(Receive data from web worker): workerObj.onmessage = function(event){ var element = document.getElementById(‘id’); element.innerHTML = event.data; }
  • 11. Terminating web worker  check weather the workerObj is undefined or not. if ( typeof workerObj !== “undefined” ) { workerObj.terminate(); }