1 / 17

Using Web Workers and Processors to Bend Data to Your Will

Using Web Workers and Processors to Bend Data to Your Will. Lloyd Heberlie, Matt Priour. Intro to workers Support Workers , processors, and ArcGIS API for JavaScript. Intro to Workers. Worker. JavaScript and multi-threading. Worker. Worker. Browser. Worker. Use cases.

yehuda
Download Presentation

Using Web Workers and Processors to Bend Data to Your Will

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using Web Workers and Processors to Bend Data to Your Will Lloyd Heberlie, Matt Priour

  2. Intro to workers • Support • Workers, processors, and ArcGIS API for JavaScript

  3. Intro to Workers Worker

  4. JavaScript and multi-threading Worker Worker Browser Worker

  5. Use cases • Prefetching data • Analyzing video / audio • Background I/O of web services • Processing data • Image filtering in <canvas>

  6. Lots of image processing examples For example … Full Color to Sepia – 255ms

  7. WorkerspostMessagemessage – serializable objecttransfers – transferable object (typed array)onmessage – message event listenerevent.data

  8. WorkerClientwraps Worker and adds PromisespostMessage PromiseimportScripts PromiseaddWorkerCallback Promise‘message’– message event

  9. Feature detection • Dojo has • Modernizr

  10. Processors Spatial Indexing esri/process/SpatialIndex

  11. Data from attached layers Direct or via Layer Single Layer Map All Graphics & Feature Layers Defined Processor. Sees all data added to layers. May intercept. Sends data to workers (parallel or serial) Processors Map or other Display Layer Stored Results - index, stats, etc

  12. Base class for processors. Must implement process functions including what and when to post data to worker. Processor Options • drawFeatures, passFeatures, workerCallback Methods • addLayer, removeLayer, setMap, unsetMap, stop

  13. Easily used by adding Spatial Indexing plugin to your layer or map plugins:[‘esri/plugins/spatialIndex’] Spatial Index indexType (‘rtree’ or ‘kdtree’) Intersects (rtree only) nearest (kdtree only) addLayer, removeLayer, setMap, unsetMap, stop

  14. Index & RenderingDemos Buffer Query Nearest Point Known Geometry Binning Density Surface

  15. Questions? mpriour@esri.com @mattpriour

More Related