Hi,
As we know Web worker is comes under HTML 5 environment.
Here we will discuss some new ideas about web worker and drawback about our old function calls.
Introduction:
1. Web Worker- executing scripts in an HTML page, the page becomes unresponsive until the script is finished
2. Web Worker- Runs in the background, independently of other scripts
Advantage of Web Worker- function:
1. Asynchronously via callback functions
2. No regression to other thread
Drawback in Normal function call (SAP UI5 environment):
1. It create single thread to all functions
2. It is difficult to use setTimer function to multiple function calls in single click
Worker function:
1. How to create instance -
new Worker("YourJAVASCRIPTNAME.js")
w.onmessage = function(event) {
}
Here we will get our response by using postMethod()
Principles:
1. It open one new thead,and create an instance to your function
Uses:
1. Asynchronous way to run function calls
2. we can set a timer while executing more function calls in a single shot
Note:
1. we can't able to get data from our parent classes/object.
Please shoot your questions :smile:
Links: http://www.w3schools.com/html/html5_webworkers.asp
Thanks,
Karthik A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |