Package io.molr.mole.core.tree.executor
Class ConcurrentStrandExecutor
- java.lang.Object
-
- io.molr.mole.core.tree.executor.ConcurrentStrandExecutor
-
- All Implemented Interfaces:
StrandExecutor
public class ConcurrentStrandExecutor extends Object implements StrandExecutor
Concurrent (non-blocking) implementation of aStrandExecutor
. Internally all the operations run on a separate thread avoiding to block theinstruct(StrandCommand)
method (or any other for that matter).This class is thread safe
-
-
Constructor Summary
Constructors Constructor Description ConcurrentStrandExecutor(Strand strand, Block actualBlock, TreeStructure structure, StrandExecutorFactory strandExecutorFactory, LeafExecutor leafExecutor, Set<Block> breakpoints, Set<Block> blocksToBeIgnored, ExecutionStrategy executionStrategy, TreeNodeStates treeNodeStates, RunState initialState)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
boolean
aborted()
Block
getActualBlock()
RunState
getActualState()
Set<StrandCommand>
getAllowedCommands()
reactor.core.publisher.Flux<Block>
getBlockStream()
Set<StrandExecutor>
getChildrenStrandExecutors()
reactor.core.publisher.Flux<Exception>
getErrorsStream()
reactor.core.publisher.Flux<QueuedCommand>
getLastCommandStream()
reactor.core.publisher.Flux<RunState>
getStateStream()
Strand
getStrand()
long
instruct(StrandCommand command)
boolean
isComplete()
String
toString()
-
-
-
Constructor Detail
-
ConcurrentStrandExecutor
public ConcurrentStrandExecutor(Strand strand, Block actualBlock, TreeStructure structure, StrandExecutorFactory strandExecutorFactory, LeafExecutor leafExecutor, Set<Block> breakpoints, Set<Block> blocksToBeIgnored, ExecutionStrategy executionStrategy, TreeNodeStates treeNodeStates, RunState initialState)
-
-
Method Detail
-
instruct
public long instruct(StrandCommand command)
- Specified by:
instruct
in interfaceStrandExecutor
-
isComplete
public boolean isComplete()
- Specified by:
isComplete
in interfaceStrandExecutor
-
getStateStream
public reactor.core.publisher.Flux<RunState> getStateStream()
- Specified by:
getStateStream
in interfaceStrandExecutor
-
getBlockStream
public reactor.core.publisher.Flux<Block> getBlockStream()
- Specified by:
getBlockStream
in interfaceStrandExecutor
-
getErrorsStream
public reactor.core.publisher.Flux<Exception> getErrorsStream()
- Specified by:
getErrorsStream
in interfaceStrandExecutor
-
getStrand
public Strand getStrand()
- Specified by:
getStrand
in interfaceStrandExecutor
-
getActualState
public RunState getActualState()
- Specified by:
getActualState
in interfaceStrandExecutor
-
getActualBlock
public Block getActualBlock()
- Specified by:
getActualBlock
in interfaceStrandExecutor
-
getAllowedCommands
public Set<StrandCommand> getAllowedCommands()
- Specified by:
getAllowedCommands
in interfaceStrandExecutor
-
getChildrenStrandExecutors
public Set<StrandExecutor> getChildrenStrandExecutors()
-
abort
public void abort()
- Specified by:
abort
in interfaceStrandExecutor
-
aborted
public boolean aborted()
- Specified by:
aborted
in interfaceStrandExecutor
-
getLastCommandStream
public reactor.core.publisher.Flux<QueuedCommand> getLastCommandStream()
-
-