Class MockWorkCorpus

java.lang.Object
ai.pipestream.module.pipelineprobe.mockengine.MockWorkCorpus

@ApplicationScoped public class MockWorkCorpus extends Object
The bounded supply of work the MockWorkEngineService hands out. Each call to next() yields one PipeStream until the configured count is exhausted, then empties (the loop then sees NoWorkAvailable and idles).

MVP corpus is synthetic — a minimal PipeStream per unit, enough to exercise any module's work-pull loop (echo round-trips it; richer stages just see an empty doc). The court-1000 fixtures (an existing CourtFixtureSource / embedder-pipedocs-court-1000) are the obvious next corpus to plug in here.

  • Constructor Summary

    Constructors
    Constructor
    Description
    CDI.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<ai.pipestream.data.v1.PipeStream>
    The next work unit, or empty once the count is exhausted.
    void
    reset(int count)
    Reset the corpus to serve count fresh units (or the configured default when count < 0).
    int
    Returns the number of work units handed out so far, capped at the effective limit.
    int
    Returns the effective unit budget this corpus will serve before draining.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockWorkCorpus

      public MockWorkCorpus()
      CDI.
  • Method Details

    • next

      public Optional<ai.pipestream.data.v1.PipeStream> next()
      The next work unit, or empty once the count is exhausted. Thread-safe across the concurrent work streams a module opens.
      Returns:
      the next PipeStream to serve, or empty when the corpus is drained
    • reset

      public void reset(int count)
      Reset the corpus to serve count fresh units (or the configured default when count < 0).
      Parameters:
      count - the new unit budget, or negative to use the default
    • servedCount

      public int servedCount()
      Returns the number of work units handed out so far, capped at the effective limit.
      Returns:
      how many units have been handed out so far.
    • totalCount

      public int totalCount()
      Returns the effective unit budget this corpus will serve before draining.
      Returns:
      the total units this corpus will hand out before draining.