new StateResolver(db [, logger])
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
db |
olympe.dc.DBView | ||
logger |
olympe.logging.Channel |
<optional> |
Methods
-
checkDeadEnd(index, tag, type [, direction])
-
Unregister the specified index if it has no child and so could block the execution of the query
Parameters:
Name Type Argument Description indexstring tagstring typestring directionolympe.dc.Direction <optional>
<nullable>
if no specified check for both directions
-
createBlock()
-
Creates a new block, child of the current block. (e.g.: used in the union transformer to split the query). Returns the id of the new created block.
Returns:
- Type
- string
-
forceSetLast(index)
-
Set the instance represented by the index to be the last one. It means that it will consider instances related to this instance as the last ones to process in the entire query tree. It is used in the transformer Limit, because we potentially reorder instances (if a sort is set before the limit), then we must restart with the right last instance.
Parameters:
Name Type Description indexstring -
getCurrentLast()
-
Returns:
the last index of the current block
- Type
- string
-
isReady()
-
Return true if the resolver is ready
Returns:
- Type
- boolean
-
onChildrenReady(callback)
-
Set the callback to execute when all children are marked as ready. When the children are all ready, it automatically set the current block to their parent (which is the current block at the method call moment).
Parameters:
Name Type Description callbackfunction -
onLast(callback [, blockId])
-
Set a function to execute when the last instance of the specified block is reached.
Parameters:
Name Type Argument Description callbackfunction blockIdstring <optional>
root block if no specified
-
register(index, parentIndex [, parentTag] [, type] [, direction])
-
Register an instance, part of the subscription resulting path.
Parameters:
Name Type Argument Description indexstring of the instance in the subscription
parentIndexstring <nullable>
if null, considers this is the root instance of the tree result
parentTagstring <optional>
previous instance in the tree result
typestring <optional>
directionolympe.dc.Direction <optional>
-
registerResult(index [, blockId])
-
Activates the specified block since the specified instance's index is a result instance.
Parameters:
Name Type Argument Description indexstring blockIdstring <optional>
root block if no specified
-
setBlockReady( [blockId])
-
Set the specified block to ready.
Parameters:
Name Type Argument Description blockIdstring <optional>
-
setCurrentBlock(id)
-
Set the current block to the specified one if exists.
Parameters:
Name Type Description idstring block id
-
setReady( [ready])
-
Set the stateResolver's state to ready
Parameters:
Name Type Argument Default Description readyboolean <optional>
true -
unregister(index)
-
Unregister an instance when it is removed from the tree result. Activates the current block and set the current block as ready if the instance is marked as the last of the current block.
Parameters:
Name Type Argument Description indexstring <nullable>
Olympe SDK