Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exponential backoff setting for retries when an extractor fails to extract or insert anything #276

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jpenilla
Copy link
Contributor

@jpenilla jpenilla commented Jul 15, 2024

In some cases we need to move large amounts of items/fluids/etc. very quickly, but only in bursts (not constantly/all the time).

By enabling backoff we can accomplish this with less of a tps hit on average.

I haven't added this to the GUI for energy extractors yet as external inventories/fluid containers tend to be much bigger lag contributors than energy, but if this concept is something the maintainers want to move forward with I can finish that TODO as well.

For reference, AE2 does something very similar with formation planes (albeit by default with no option), and I'm sure other mods also implement similar ideas.

In the following example, the item card is set to a maximum backoff of 2^3. This means that on each failure or success, the card will increment or decrement the power of 2 used between 0 (2^0 * 4, 4 ticks, normal delay) and 3 (2^3 * 4 ticks, or 32 ticks after 3 successive failures).
Screenshot 2024-07-17 at 6 28 11 PM

@jpenilla jpenilla force-pushed the exponential-backoff branch from 085d097 to 8c43865 Compare July 15, 2024 08:58
…o extract or insert anything

In some cases we need to move large amounts of items/fluids/etc. very quickly, but only in bursts (not constantly/all the time).

By enabling backoff we can accomplish this with less of a tps hit on average.
@jpenilla jpenilla force-pushed the exponential-backoff branch from 8c43865 to bcd0b73 Compare July 15, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant