Really? Why do mine always show up with the with listed as location? Am I doing something wrong?
[SOLVED] Tasks not executing in parallel
Different… But not wrong. As they say around here “open world” so you can pretty much do it however you like. Inside the piston in Edit mode they would look like this:
But when saved they look like this:
Ah…I’m not using Location, I’m using $Location. Evidently, they are different.
When you use $location, the with shows up in display and edit mode.
fyi async only matters when there is a wait statement. each async statement tells the piston to not pause execution at the next wait and continue executing the piston with the statement following the with block containing the wait.
also fyi piston parallelism when turned on creates a 2nd instance of the piston to handle incoming events. while there will be 2 instances of the piston all variables in the define block are shared and each piston does not get its own instance of variables.
Hey sir;
I didnt see that way. The “with” came because I needed to use a device and put some following commandas for that device alone. Is there another way to write that and do the same thing?
Done for it and worked flawlessly. Is there an way for setting this by default? Because if I want something for wait I would put that inserted into the code anyways.
So, async doesn’t start all with’s for the same if at the same time, it just skips the wait? Am i getting that correct? This is getting more confusing rather than less. LOL Just when you think you understand something…
Also, if you set up two piston with the same trigger included in both, will both fire at the same time by default or do you have to engage parallelism to get them to both fire?
Not that I’ve ever seen. You have to set it each time you want it that way. You’d probably have to ask for a new feature to get this to be happen.
async tells webcore to not pause the piston at any wait timer within the async block rather continue execution with the statements after the async block.
two pistons with the same trigger would both receive the same event and get triggered without parallelism being set. parallelism is only required when you want two copies of the same piston to run and handle events that meant for just that piston. each event meant for that piston will be sent to one of the copies
of that piston.
Passing variables through pistons
@bangali I am trying to execute the use case you’re describing, i.e., I am spawning multiple pistons that are executing on different devices, however I cannot get this to work. The device is getting passed as an $arg to the spawned piston, but it’s not controlling all of them properly. They do correctly receive the ‘Turn On’ command when called, but only the last one gets the Turn Off command.
Thanks, I had already created a new thread, which I just updated based on where I am right now. Still struggling to get this to work…Here’s the link: Passing variables through pistons
It’s meant for the comment only, I had a comment in the original message and cant figure out how to delete completely:-(, will change the message