LibFiber

This library will help you to split big amount of calls that you can't control under combat lockdown to separate "fibers" in same frame to avoid "script ran too long" errors.

Available functions

Just one for the moment:

lib:WrapVoidMethod(object, method)

Given object and method name, this function will replace original method with a wrapper that will either just call the original if you're out of combat or reschedule it to separate "fiber" in same frame created through Blizzard's timer call that happen to have separate execution time limit and thus helps to avoid "script ran too long" error caused by sheer amount of calls per frame.

This function is intended to wrap calls that are fast enough by themselves but that could be called in amounts that you, as developer, can't control. For example: action or macro buttons if your addon allows to create unlimited amount - even if one button update reliably takes, say, 2ms, user who creates over 100 buttons will hit "script ran too long"; item slot buttons - their amount just naturally increases as Blizzard introduces larger bags; etc.

Wrapped method must have no arguments or returns except implied "self" as they're silently dropped. This generally fits the signature of :Update methods that read data from their instance.

DO try to optimize problematic function as much as possible - even if you wrap it, total time of calls will still incur noticeable FPS hiccup and wrapper will also add some overhead to that. DO separate multiple calls manually to different frames if your updates have some predictable pattern and don't really need visual or whatever result instantly. For example updating texture, count or cooldown on item slot should happen as soon as player opens bag window or relevant event happens, while drawing highlight border for custom search can be split over several next frames and player won't even notice it.

Included EXAMPLE.lua file shows example of usage and allows you to test how it works.

Download

File Name Status Version Downloads Date
v2 R 6.1.0 685 28/02/2015
v1 R 6.0.3 115 09/02/2015
LibFiber 7.3.0 Updating 7.3.0 Updating Updating
LibFiber 7.3.2 Updating 7.3.2 Updating Updating
LibFiber 7.3.5 Updating 7.3.5 Updating Updating
LibFiber 8.0.1 Updating 8.0.1 Updating Updating
LibFiber 8.1.0 Updating 8.1.0 Updating Updating
LibFiber 8.1.5 Updating 8.1.5 Updating Updating
LibFiber 8.2.0 Updating 8.2.0 Updating Updating
LibFiber 8.2.5 Updating 8.2.5 Updating Updating
LibFiber
LibFiber

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