package js.html
extends EventTarget
Available on jsThe
Worker
interface of the Web Workers API represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling theWorker()
constructor and specifying a script to be run in the worker thread.Documentation Worker by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See:
new (scriptURL:String)
Throws:
null |
DOMError |
---|
onerror:Function
onmessage:Function
An EventListener
called whenever a MessageEvent
of type message
bubbles through the worker — i.e. when a message is sent to the parent document from the worker via DedicatedWorkerGlobalScope.postMessage
. The message is stored in the event's MessageEvent.data
property.
postMessage (message:Dynamic, ?transfer:Array<Dynamic>):Void
Throws:
null |
DOMError |
---|
terminate ():Void
Immediately terminates the worker. This does not offer the worker an opportunity to finish its operations; it is simply stopped at once. ServiceWorker instances do not support this method.
© 2005–2016 Haxe Foundation
Licensed under a MIT license.
http://api.haxe.org/js/html/Worker.html