Async Operations - stop async run (Effect) — SkRedis

Addon: SkRedis · Category: Effect · Since: 1.2.0

Syntax

stop run [redis] async

Description

Stops an async run that was started with `run async`.

Examples


command /test1:
    trigger:
        loop all items:
            set field "%loop-value%" to "test" in redis hash "testHash"

command /test2:
    trigger:
        set {_n} to 0
        broadcast "Starting loop with initial value of _n: %{_n}%"
        loop all items:
            run async:
                add 1 to {_n}
                broadcast value of field "%loop-value%" in redis hash "testHash"
                broadcast "Current value of _n: %{_n}%"
                if {_n} >= 10:
                    broadcast "Done with %{_n}% iterations"
                    stop run async

View source