Skip to main content

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:
NameTypeDescription
operationsArrayEncoded 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:
NameTypeAttributesDescription
srcURI<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:
NameTypeDescription
messageanyWorker response

Overrides:

  • Threads.ThreadPool#recieve

reject()

Action reject

Overrides:

  • Threads.ThreadPool#reject

resolve(value)

Action resolve

Parameters:
NameTypeDescription
valueanyProduced value

Overrides:

  • Threads.ThreadPool#resolve

send(index, message)

Send a message to particular worker

Parameters:
NameTypeDescription
indexintTarget worker. Property 'worker' in recieved message tells where response is coming from.
messageanyWorker request

Overrides:

  • Threads.ThreadPool#send

(abstract) updateProgress(value, expected)

Reports build progress

Parameters:
NameTypeDescription
valuefloatPercent of finished tasks
expectedintCount of tasks that are not processed yet

Home