Package arez.annotations
Enum Class Priority
- All Implemented Interfaces:
Serializable
,Comparable<Priority>
,Constable
Enum to control scheduling priority of observers/reactions.
Observers with higher priorities will react first. If observers have equal priorities then observers
scheduled first will react first. Observers must not depend upon ComputableValue instances with
a lower priority otherwise priority is ignored.
A user should be very careful when specifying a HIGH
priority as it is possible that
the the reaction will be scheduled part way through the process of disposing and/or unlinking one-or-more
components. Dispose reactions will often be scheduled with a higher priority but reactions unlinking disposed
arez components from remaining arez components. In many cases this may mean invoking
Disposable.isDisposed(Object)
before accessing arez components.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
-
Enum Constant Details
-
HIGHEST
Highest priority. This priority should be used when the reaction will dispose other reactive elements (and thus they need not be scheduled). -
HIGH
High priority. This priority should be used when the reaction will trigger many downstream reactions. -
NORMAL
Normal priority. -
LOW
Low priority. Usually used to schedule observers that reflect state onto non-reactive application components. i.e. Observers that are used to build html views, perform network operations etc. These reactions are often at low priority to avoid recalculation of dependencies (i.e.ComputableValue
s) triggering this reaction multiple times within a single reaction round. -
LOWEST
Lowest priority. This is low-priority reactions that reflect onto non-reactive applications. It is also used for (i.e.ComputableValue
s) that may be unobserved when aLOW
priority reaction runs. -
DEFAULT
Default priority. Use the value of theArezComponent.defaultPriority()
specified at the component level orNORMAL
if for the value ofArezComponent.defaultPriority()
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-