Replies: 2 comments
-
The two approaches I can imagine are calculating the balance outside the processor and then when dispatching the job, passing the value in as job data. If that's not possible the next approach would be to calculate the balance outside the processor and store it somewhere (redis, database, etc) and then your processor reads the current value when it starts running. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the swift response and suggestion. Regarding the 1. option, if it's a repeatable job, would you remove the repeatable flag and just add the job "manually" in the on-complete event with this data or how would be the best way to approach this? |
Beta Was this translation helpful? Give feedback.
-
Hello,
I wanted to ask, is there any way the sandboxed process can access the variables assigned in the top/side process?
I have noticed there is no way for this processor to reach these variables. Lets say I have a processor (repeatable) that runs some math operations on a constantly changing balance. This balance is handled and saved in a separate "library" ('lib/balance.js'), I can require this library in this processor but since every iteration of this repeatable job spawns a new process the library is always empty and the crucial variables are unassigned - since they have been assigned separately. Is there any way to share variables between these two parts? (ie. sending the current library to the processor current job iteration? or any other way?) Or is it necessary to move the balance update logic into the processor?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions