Problem with stopping fibers

131 views
Skip to first unread message

Qbi Wan

unread,
Apr 23, 2024, 7:10:31 AMApr 23
to Automate for Android
Hi. 
I know scheme below does nothing except showing quick seeing tile. But I need it to test something:
In my mind at 1st start of fiber it will just show tile. At second attempt it should do the same thing BUT it should stop precious fiber first. Instead it adds up, showing 2, 3 etc fibers running.
I'm using So Fiber in other flows with success, I don't know what am I doing wrong here. 
Can somebody help?
Screenshot_20240423_130255.jpg

Henrik "The Developer" Lindqvist

unread,
Apr 23, 2024, 10:45:43 AMApr 23
to Automate for Android
The NEW path of the Fork block is unconnected so it does nothing, it's only the OK path that shows a tile, and it will await you to click it, sequentially, hence there's on previous fiber.

​ ​man

unread,
Apr 24, 2024, 8:25:41 AMApr 24
to Automate for Android
This deosn't look like there are new fibers created (like Henrik said the Fork block has "NEW" dot unconected so it does nothing). In the Fork block you should (but don't have to) give both flows different names while now I see you named both "Test Flow". Fiber stop block stops flow named "Test Flow" – but is the variable set before this block is executed (I see the only chance is to set it in "Flow beginning" block; but I doubt). What you write doesn't match what you showed... 🤔

​ ​man

unread,
Apr 24, 2024, 8:29:59 AMApr 24
to Automate for Android
Oh I unsderstand. You mean that when you START THE FLOW for the 1st time it shows a Quick Tile, and when you START THE FLOW (parallel) for the 2nd time you want it to stop the 1st flow?
Each fibers starts with it's own variables so your 2nd flow doesn't know the name of the 1st one. You have to take care of the concurrency (sharing information between various fibers and flows). Use either Atomic variables (they are global for all flows, but every time flow has to save it to global and read it from global), Variables give/take, Cloud, Broadcast or saving information in a file in phone storage. In your case best would be Atomics or file.
Message has been deleted
Message has been deleted

Qbi Wan

unread,
Jun 27, 2024, 7:13:06 AM (7 days ago) Jun 27
to Automate for Android
Screenshot_20240623_191435_com.llamalab.automate_edit_451455092416007.jpgGG
That's what I mean, but I can't agree with you. In example above when I use TestStart, tile turns on. When I use Reset it should kill TestStart. Variable is given in command itself: Fiber stop Test flow. It should find and terminate designated flow. What else variable would it need?

​ ​man

unread,
Jun 27, 2024, 7:33:05 AM (7 days ago) Jun 27
to Automate for Android
Each fiber (also fiber Reset) starts with no known variables. Only thing known is itself (its name). And each variable is restricted to the fiber, not to whole flow - fast means that each fiber uses its own variables, even if the variable has the same name. Unless... you make the variable a global variable (aka atomic) or pass it (concurrency: variables give/take, broadcast etc.). 

​ ​man

unread,
Jun 27, 2024, 7:33:25 AM (7 days ago) Jun 27
to Automate for Android
so you know any programming language? 

Qbi Wan

unread,
Jun 27, 2024, 1:43:17 PM (7 days ago) Jun 27
to Automate for Android
Actually i do a little.
I was playing with Game Maker Studio from YoYo. It uses java i guess. But it operates on single 'thread'.
Screenshot_20240627_173748_edit_458333718260791.jpg
Above is my other flow: fork circled green creates new fiber "notificationTimerFlow", which creates notification (blue circle). When chosen time passes, main fiber kills  "notificationTimerFlow" resulting in notification disappearance - as intended. I was trying to use the same mechanism in my new flow with no success.
Reply all
Reply to author
Forward
0 new messages