Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
using-worker-threads-with-konduktiva [2024/01/04 05:36] – steve.wang | using-worker-threads-with-konduktiva [2024/03/20 18:36] (current) – steve.wang | ||
---|---|---|---|
Line 3: | Line 3: | ||
**Overview: ** Sometimes running too many actions in the same nodejs thread can cause Konduktiva sequencing to be delayed because of the heavy load on the system and the single threaded nature of nodejs. To avoid this issue, we can create other threads and run heavy actions there. Reading the [[https:// | **Overview: ** Sometimes running too many actions in the same nodejs thread can cause Konduktiva sequencing to be delayed because of the heavy load on the system and the single threaded nature of nodejs. To avoid this issue, we can create other threads and run heavy actions there. Reading the [[https:// | ||
- | **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https:// | + | **Things To Note:** This tutorial assumes you have already installed Konduktiva successfully using the [[https:// |
+ | <code javascript> | ||
+ | const K = require(' | ||
+ | let e = K.setUpMusicalEnvironment(K.defaultConfigurationObject, | ||
+ | </ | ||
===== giveWorkerWork ===== | ===== giveWorkerWork ===== | ||
Line 36: | Line 39: | ||
let testResult = await K.giveWorkerWork(requireTest) | let testResult = await K.giveWorkerWork(requireTest) | ||
</ | </ | ||
+ | |||
+ | Here is an example of adding the information given by workers to the musical environment. In this example, I will user workers to create a QuantizedMap for filterMap. The contents will be the same as chromatic. | ||
+ | <code javascript> | ||
+ | let QWorkerCode = `let {QuantizedMap} = require(' | ||
+ | let QResults = await K.giveWorkerWork(QWorkerCode) | ||
+ | e.modeFilters.sameAsChromatic = new K.QuantizedMap(QResults.keyspan, | ||
+ | </ | ||
+ | |||
+ |