Class: SplitPointsProducer
SplitPointsProducer()
Provides parallel split spline points building of intersector over all available CPU cores## Constructor
new SplitPointsProducer()
Extends
- Threads.ThreadPool
Methods
(async) broadcast()
Bulk execution of action to all workers
Overrides:
- Threads.ThreadPool#broadcast
(async) build(operations)
Parameters:
Name | Type | Description |
---|---|---|
operations | Array | Encoded node processing info groups |
(abstract) buildRequestMessage() → {any}
Build message for particular action. Implementation is not required. broadcast relies on this method.
Overrides:
- Threads.ThreadPool#buildRequestMessage
Returns:
message Worker request
Type
any
close()
Terminate all underlying workers
Overrides:
- Threads.ThreadPool#close
(async) open(srcopt)
Generate n workers based on CPU cores. Invokes worker INIT action.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
src | URI | <optional> | Worker location.Defaults to /node_modules/digital-ink/workers/${name}Param is required in DedicatedWorkerGlobalScope.It is also required when underlying env is not connected with node_modules structure. |
Overrides:
- Threads.ThreadPool#open
(abstract) recieve(message)
Worker response handler
Parameters:
Name | Type | Description |
---|---|---|
message | any | Worker response |
Overrides:
- Threads.ThreadPool#recieve
reject()
Action reject
Overrides:
- Threads.ThreadPool#reject
resolve(value)
Action resolve
Parameters:
Name | Type | Description |
---|---|---|
value | any | Produced value |
Overrides:
- Threads.ThreadPool#resolve
send(index, message)
Send a message to particular worker
Parameters:
Name | Type | Description |
---|---|---|
index | int | Target worker. Property 'worker' in recieved message tells where response is coming from. |
message | any | Worker request |
Overrides:
- Threads.ThreadPool#send
(abstract) updateProgress(value, expected)
Reports build progress
Parameters:
Name | Type | Description |
---|---|---|
value | float | Percent of finished tasks |
expected | int | Count of tasks that are not processed yet |