Skip to main content

Class: InkPathProducer

InkPathProducer()​

Provides parallel path building of strokes over all available CPU cores## Constructor

new InkPathProducer()​

Extends​

  • Threads.ThreadPool

Methods​

(async) broadcast()​

Bulk execution of action to all workers

Overrides:

  • Threads.ThreadPool#broadcast

(async) build(strokes, settings)​

Parameters:​
NameTypeDescription
strokesArray.<Stroke>
settingsPathBuilding.InkBuilderSettingsCompliant settings are: lastPipelineStage, keepAllData, errorThreshold, keepSplineParameters

(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) importBrushes(brushes)​

Parameters:​
NameTypeDescription
brushesArray.<Rendering.Brush>

(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, stroke)​

Reports build progress

Parameters:​
NameTypeDescription
valuefloatPercent of built strokes
expectedintCount of strokes that are not processed yet
strokeStrokeProcessed stroke

Home​