new WorkerDirector(classDef, logger)
Orchestrate loading of multiple OBJ files/data from an instruction queue with a configurable amount of workers (1-16). Workflow: prepareWorkers enqueueForRun processQueue deregister
Parameters:
| Name | Type | Description |
|---|---|---|
classDef |
string | Class definition to be used for construction |
logger |
THREE.LoaderSupport.ConsoleLogger | logger to be used |
Methods
-
<static> WorkerDirector#deregister()
-
Terminate all workers.
-
<static> WorkerDirector#enqueueForRun(prepData)
-
Store run instructions in internal instructionQueue.
Parameters:
Name Type Description prepDataTHREE.LoaderSupport.PrepData -
<static> WorkerDirector#getMaxQueueSize()
-
Returns the maximum length of the instruction queue.
Returns:
- Type
- number
-
<static> WorkerDirector#getMaxWebWorkers()
-
Returns the maximum number of workers.
Returns:
- Type
- number
-
<static> WorkerDirector#prepareWorkers(globalCallbacks, maxQueueSize, maxWebWorkers)
-
Create or destroy workers according limits. Set the name and register callbacks for dynamically created web workers.
Parameters:
Name Type Description globalCallbacksTHREE.OBJLoader2.WWOBJLoader2.PrepDataCallbacks Register global callbacks used by all web workers
maxQueueSizenumber Set the maximum size of the instruction queue (1-1024)
maxWebWorkersnumber Set the maximum amount of workers (1-16)
-
<static> WorkerDirector#processQueue()
-
Process the instructionQueue until it is depleted.
-
<static> WorkerDirector#setCrossOrigin(crossOrigin)
-
Sets the CORS string to be used.
Parameters:
Name Type Description crossOriginstring CORS value