Package io.molr.mole.core.tree
Class ConcurrentStrandExecutor
- java.lang.Object
-
- io.molr.mole.core.tree.ConcurrentStrandExecutor
-
- All Implemented Interfaces:
StrandExecutor
public class ConcurrentStrandExecutor extends java.lang.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(io.molr.commons.domain.Strand strand, io.molr.commons.domain.Block actualBlock, TreeStructure structure, StrandFactory strandFactory, StrandExecutorFactory strandExecutorFactory, LeafExecutor leafExecutor, java.util.Set<io.molr.commons.domain.Block> breakpoints)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description io.molr.commons.domain.Block
getActualBlock()
io.molr.commons.domain.RunState
getActualState()
java.util.Set<io.molr.commons.domain.StrandCommand>
getAllowedCommands()
reactor.core.publisher.Flux<io.molr.commons.domain.Block>
getBlockStream()
java.util.Set<StrandExecutor>
getChildrenStrandExecutors()
reactor.core.publisher.Flux<java.lang.Exception>
getErrorsStream()
reactor.core.publisher.Flux<io.molr.commons.domain.StrandCommand>
getLastCommandStream()
Deprecated.reactor.core.publisher.Flux<io.molr.commons.domain.RunState>
getStateStream()
io.molr.commons.domain.Strand
getStrand()
void
instruct(io.molr.commons.domain.StrandCommand command)
void
moveTo(io.molr.commons.domain.Block block)
Deprecated.java.lang.String
toString()
-
-
-
Constructor Detail
-
ConcurrentStrandExecutor
public ConcurrentStrandExecutor(io.molr.commons.domain.Strand strand, io.molr.commons.domain.Block actualBlock, TreeStructure structure, StrandFactory strandFactory, StrandExecutorFactory strandExecutorFactory, LeafExecutor leafExecutor, java.util.Set<io.molr.commons.domain.Block> breakpoints)
-
-
Method Detail
-
instruct
public void instruct(io.molr.commons.domain.StrandCommand command)
- Specified by:
instruct
in interfaceStrandExecutor
-
getStateStream
public reactor.core.publisher.Flux<io.molr.commons.domain.RunState> getStateStream()
- Specified by:
getStateStream
in interfaceStrandExecutor
-
getBlockStream
public reactor.core.publisher.Flux<io.molr.commons.domain.Block> getBlockStream()
- Specified by:
getBlockStream
in interfaceStrandExecutor
-
getErrorsStream
public reactor.core.publisher.Flux<java.lang.Exception> getErrorsStream()
- Specified by:
getErrorsStream
in interfaceStrandExecutor
-
getLastCommandStream
@Deprecated public reactor.core.publisher.Flux<io.molr.commons.domain.StrandCommand> getLastCommandStream()
Deprecated.
-
getStrand
public io.molr.commons.domain.Strand getStrand()
- Specified by:
getStrand
in interfaceStrandExecutor
-
getActualState
public io.molr.commons.domain.RunState getActualState()
- Specified by:
getActualState
in interfaceStrandExecutor
-
getActualBlock
public io.molr.commons.domain.Block getActualBlock()
- Specified by:
getActualBlock
in interfaceStrandExecutor
-
getAllowedCommands
public java.util.Set<io.molr.commons.domain.StrandCommand> getAllowedCommands()
- Specified by:
getAllowedCommands
in interfaceStrandExecutor
-
moveTo
@Deprecated public void moveTo(io.molr.commons.domain.Block block)
Deprecated.TODO think about a command for this!! A parametrized command will also solve the concurrency issues that the implementation below have
-
getChildrenStrandExecutors
public java.util.Set<StrandExecutor> getChildrenStrandExecutors()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-