img



img

Corout


By: _ForgeUser11683517
Addon | img 523




Description

___________________________________________________________________________________________________________________________

Description

This library has been created to keep out of the watchdog easily. Instead of having to write the whole coroutine mechanic each time you have performance issues, you can use this. It permit to create a coroutine in a couple of lines.

To use it, just call corout(YourFunction) and it will start a coroutine running YourFunction automatically. You have to call corout.check() sometimes in your function to verify that the watchdog isn't about to cut of you addon.

It is recommended to add a label to all your corouts in order to be safe with others addons and your own addon when you use multiples corouts together. In addition, you're allowed to pass as much parameters as you wish after those ones. You may get something like corout(MyFunction, "Corout MyLabel", MyArg1, MyArg2, ...). You can also define another time remaining limit before watchdog alarm if you want to (default is 0.03).

Here is an example :

function example(arg1, arg2)
    for foo, foo2 in pairs(arg) do
        arg2[foo] = foo2
        -- do something here

        corout.check()      -- check the watchdog state
    end
end

corout(example, "Corout AddonIdentifier", arg1, arg2)

If you have any suggestion or feedback, i would be glad to hear it.




About Project

Created: September 21st 2023

Updated: September 21st 2023

Project ID: 90828

License: All Rights Reserved

__________________________________________

Game Versions:

1.01.03

1.01.03

1.01.03

1.01.03

1.01.03

__________________________________________

Flavors:

WoW Retail

__________________________________________

Categories

Companions

Battle

__________________________________________

Main File

_ForgeUser11683517_Corout.zip
  • Release
  • September 21st 2023

    __________________________________________

    Recent File

    _ForgeUser11683517_Corout.zip
  • Release
  • September 21st 2023

    __________________________________________

    Members

    img
    _ForgeUser11683517
    Owner

    __________________________________________

    Report