haochi / angular2-web-worker

Web worker for Angular 2
https://www.npmjs.com/package/angular2-web-worker
51 stars 10 forks source link

Use transferList for angular2-web-workers communication. #10

Closed WolfSoko closed 1 year ago

WolfSoko commented 7 years ago

Added the optional parameter transferList to the WebWorkerService use function. If provided, the parameter is set as the transferList parameter of the postMessage method. It is used to give control over an e.g. ArrayBuffer to the execution context of the webworker without cloning the hole data.

Also the webworker can now provide a transferList inside the return object.

This can be usefull for task like image manipulation and everything that needs to transfer a big amount of data.

Also I implemented an example showing the times used for big data transfer with and without transferList.

Also I raised the version number to 0.0.7