Skip to content

Retry ​

Retries a function with exponential backoff until it succeeds or exceeds the maximum number of attempts.

Functions ​

Retry Yields ​

luau
Retry(callback: (...any) -> any | nil, attempts: number?, base: number?, ...: any?): (boolean, any)

Parameters

  • callback: The function to retry
  • attempts: Number of retry attempts (Default: 5)
  • base: Backoff delay exponent base, adds a delay of base ^ attempts between attempts (Default: 2)
  • ...: Additional arguments to pass to the callback function

Returns

  • boolean: Whether the pcall succeeded, followed by its results