Interface ParallelChunkOperation

All Known Implementing Classes:
PoolProcessor

public interface ParallelChunkOperation
The ParallelChunkOperation interface is implemented by classes that perform a ChunkOperation on a set of chunk positions in parallel.
Since:
3.4.0
Author:
Peter Hollemans
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels a parallel operation in progress.
    void
    Initializes the parallel operation.
    void
    Starts the parallel operation.
    void
    Waits for completion of a parallel operation.
  • Method Details

    • init

      void init(List<ChunkPosition> positions, ChunkOperation op)
      Initializes the parallel operation.
      Parameters:
      positions - the list of chunk positions to operate on.
      op - the chunk operation to perform at each position.
    • start

      void start()
      Starts the parallel operation.
    • cancel

      void cancel()
      Cancels a parallel operation in progress. Some instances of chunk operations in progress may take time to complete, but no more operations are started after the call to this method.
    • waitForCompletion

      void waitForCompletion()
      Waits for completion of a parallel operation. If the parallel operation has been cancelled, this method will also wait for any chunk operations that were already in progress when cancel() was called. Otherwise it simply waits until all operations are complete and returns.