HTML5 Web Workers
Web Workers objects act as if they had an implicit MessagePort associated with them. This port is part of a channel that is set up when the worker is created and never be garbage collected before the Web Workers object. Only DedicatedWorker is supported.
Learning Resources:
| Sample - Using HTML5 Web Worker Sample that demonstrates how to use the HTML5 Web Workers API [BlackBerry Developer Resource Center]. |
Supported Platform(s)
| - BlackBerry OS 5.0+ |
| - BlackBerry PlayBook 1.0+ |
| - BlackBerry 10 |
| - Ripple Emulator |
| API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
|---|---|---|---|---|---|---|---|
| Worker | Y | Y | Y | Y | Y | Y | Y |
| onmessage | Y | Y | Y | Y | Y | Y | Y |
| postMessage | Y | Y | Y | Y | Y | Y | Y |
| applicationCache | Y | Y | Y | Y | Y | Y |
Configuration Document Settings
|
To use all of the API described for this object, you must ensure the following settings are in your configuration document: |
| This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
| Permission Elements (PlayBook and BlackBerry 10+) |
|---|
| This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
Constructors
Functions
void
onmessage
([messageText : String], [senderId : String], [messageObject : Object])
The onmessage is the event handler as IDL attributes to Web Workers ojbect.
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - BlackBerry PlayBook 1.0+ | |
| - BlackBerry 10 | |
| - Ripple Emulator | |
| Parameters | |
|---|---|
| messageText | text message. |
| senderId | sender ID. |
| messageObject | message object when send. |
void
postMessage
(message : Object)
The postMessage() method on Web Workers objects invoked the method of the same name on the port, with the same arguments, and returned the same return value.
| Supported Platforms | |
|---|---|
| - BlackBerry OS 5.0+ | |
| - BlackBerry PlayBook 1.0+ | |
| - BlackBerry 10 | |
| - Ripple Emulator | |
| Parameters | |
|---|---|
| message | A message to post when worker is created. |
Code Example:
|
Properties
ApplicationCache
applicationCache
The ApplicationCache object associated with this worker
| Supported Platforms | |
|---|---|
| - BlackBerry OS 6.0+ | |
| - BlackBerry PlayBook 1.0+ | |
| - BlackBerry 10 | |
| - Ripple Emulator | |
Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:17:53 GMT-0500 (EST)