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,
                                        StrandFactory strandFactory,
                                        StrandExecutorFactory strandExecutorFactory,
                                        LeafExecutor leafExecutor,
                                        java.util.Set<io.molr.commons.domain.Block> breakpoints,
                                        io.molr.commons.domain.ExecutionStrategy executionStrategy)
    • Method Detail

      • instruct

        public void 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
      • 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 interface StrandExecutor
      • getAllowedCommands

        public java.util.Set<io.molr.commons.domain.StrandCommand> getAllowedCommands()
        Specified by:
        getAllowedCommands in interface StrandExecutor
      • 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 class java.lang.Object