Corout

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.

Download

File Name Status Version Downloads Date
Corout 1.0 R 2.3 452 16/07/2013
Corout 5.0 Updating 5.0 Updating Updating
Corout 4.0 Updating 4.0 Updating Updating
Corout 3.7 Updating 3.7 Updating Updating
Corout 3.6 Updating 3.6 Updating Updating
Corout 3.5 Updating 3.5 Updating Updating
Corout 3.4 Updating 3.4 Updating Updating
Corout 3.0 Updating 3.0 Updating Updating
Corout
Corout

Dear youtuber!
Have you a channel youtube and want to bring your Video to quality visitors?
Do you want your video to appear on our website?
Do you want to become partner with us?
Just 3 steps to become our partner:
Step 1: Make video review for mods, addons, plugins, ... which you like
Step 2: Upload this video to youtube and our link to your video description
Step 3: Send the youtube video link via message to http://fb.com/9lifehack or leave a comment in the post. We will add your video in the our post, it will help you have more view.
JOIN to get more youtube view with us!!!!

Related Posts

Smarty Productivity Happiness

9LifeHack.com - make things smart