Class ConcurrentStrandExecutor

  • All Implemented Interfaces:
    StrandExecutor

    public class ConcurrentStrandExecutor
    extends java.lang.Object
    implements StrandExecutor
    Concurrent (non-blocking) implementation of a StrandExecutor. Internally all the operations run on a separate thread avoiding to block the instruct(StrandCommand) method (or any other for that matter).

    This class is thread safe

    • Constructor Detail

      • ConcurrentStrandExecutor

        public ConcurrentStrandExecutor​(io.molr.commons.domain.Strand strand,
                                        io.molr.commons.domain.Block actualBlock,
                                        TreeStructure structure,
                                        StrandExecutorFactory strandExecutorFactory,
                                        LeafExecutor leafExecutor,
                                        java.util.Set<io.molr.commons.domain.Block> breakpoints,
                                        java.util.Set<io.molr.commons.domain.Block> blocksToBeIgnored,
                                        io.molr.commons.domain.ExecutionStrategy executionStrategy,
                                        TreeNodeStates treeNodeStates,
                                        io.molr.commons.domain.RunState initialState)
    • Method Detail

      • instruct

        public long instruct​(io.molr.commons.domain.StrandCommand command)
        Specified by:
        instruct in interface StrandExecutor
      • getStateStream

        public reactor.core.publisher.Flux<io.molr.commons.domain.RunState> getStateStream()
        Specified by:
        getStateStream in interface StrandExecutor
      • getBlockStream

        public reactor.core.publisher.Flux<io.molr.commons.domain.Block> getBlockStream()
        Specified by:
        getBlockStream in interface StrandExecutor
      • getErrorsStream

        public reactor.core.publisher.Flux<java.lang.Exception> getErrorsStream()
        Specified by:
        getErrorsStream in interface StrandExecutor
      • getStrand

        public io.molr.commons.domain.Strand getStrand()
        Specified by:
        getStrand in interface StrandExecutor
      • getAllowedCommands

        public java.util.Set<io.molr.commons.domain.StrandCommand> getAllowedCommands()
        Specified by:
        getAllowedCommands in interface StrandExecutor
      • getChildrenStrandExecutors

        public java.util.Set<StrandExecutor> getChildrenStrandExecutors()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getLastCommandStream

        public reactor.core.publisher.Flux<QueuedCommand> getLastCommandStream()