@FunctionalInterface public interface Scannable
Stream queries from
actuals(), parents() and inners(). This allows for
visiting patterns and possibly enable serviceability features.
Scannable is also a useful tool for the advanced user eager to learn which kind of state we usually manage in the package-scope schedulers or operators implementations.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Scannable.Attr
A list of reserved keys for component state scanning
|
| Modifier and Type | Method and Description |
|---|---|
default Stream<? extends Scannable> |
actuals()
Return a
Stream navigating the Subscriber
chain (downward). |
static Scannable |
from(Object o)
|
default Stream<? extends Scannable> |
inners()
Return a
Stream of referenced inners (flatmap, multicast etc) |
default boolean |
isScanAvailable()
Return true whether the component is available for
scan(Attr) resolution. |
default Stream<? extends Scannable> |
parents()
Return a
Stream navigating the Subscription
chain (upward). |
Object |
scan(Scannable.Attr key)
Return an eventual value or null for a given component state
Scannable.Attr |
default <T> T |
scan(Scannable.Attr key,
Class<T> type)
Resolve a value given an
Scannable.Attr within the Scannable. |
default <T> T |
scanOrDefault(Scannable.Attr key,
T defaultValue)
Resolve a value given an
Scannable.Attr within the Scannable. |
static Scannable from(Object o)
o - a reference to castScannable, null or Scannable.Attr.UNAVAILABLE_SCANdefault Stream<? extends Scannable> actuals()
Stream navigating the Subscriber
chain (downward).Stream navigating the Subscriber
chain (downward)default Stream<? extends Scannable> inners()
Stream of referenced inners (flatmap, multicast etc)Stream of referenced inners (flatmap, multicast etc)default boolean isScanAvailable()
scan(Attr) resolution.scan(Attr) resolution.default Stream<? extends Scannable> parents()
Stream navigating the Subscription
chain (upward).Stream navigating the Subscription
chain (upward)Object scan(Scannable.Attr key)
Scannable.Attrkey - an Scannable.Attr to get the operator statedefault <T> T scan(Scannable.Attr key, Class<T> type)
Scannable.Attr within the Scannable. If unresolved
return the
passed default value.key - a Scannable.Attr to resolve the value within the contexttype - the attribute typedefault <T> T scanOrDefault(Scannable.Attr key, T defaultValue)
Scannable.Attr within the Scannable. If unresolved
return the
passed default value.key - a Scannable.Attr to resolve the value within the contextdefaultValue - a fallback value if key doesn't resolve