Namespace and Class LrRecursionGuard
This namespace and class provides a simple recursion guard for function execution. The typical case for using this is to prevent a chain of observation handlers from triggering infinite recursion.
Use the imported namespace as a constructor; access the functions through the created objects.
Summary
LrRecursionGuard( name )
Creates a new recursion guard.
recursionGuard:performWithGuard( func, ... )
Calls a function, but only if we are not already inside a call that has been guarded by this guard.
(Boolean) True if this recursion guard is currently active; that is, currently inside a call to
recursionGuard:performWithGuard()
.Functions
- LrRecursionGuard( name )
-
Creates a new recursion guard.
First supported in version 2.0 of the Lightroom SDK.
Parameters
- 1. name
- (optional, string) A name for this recursion guard, used only for debugging.
Return value
ArecursionGuard
object. - recursionGuard:performWithGuard( func, ... )
-
Calls a function, but only if we are not already inside a call that has been guarded by this guard. If
recursionGuard.active == true
, does nothing.First supported in version 2.0 of the Lightroom SDK.
Parameters
- 1. func
- (function) The function to call.
- 2. ...
- Any additional parameters are passed through to the function being called.