txt: ## dist_zef-lizmat-ParaSeq.md
  ## Chunk 2 of 2
   correct granularity (as the deliverer is unaware of any granularity restrictions). The batcher then fetches that many values from the source iterator and schedules another job for a worker thread with the values obtained (if any).
  
  ## Step 10: start delivering
  
  At this point a `ParaIterator` object is created and installed as the (result) `.iterator` of the invocant. The paralellizing logic in the hypered variant of the method is started, which then in turn starts feeding the `ParaIterator`.
  
  It is then up to the code that iterators over the (result) iterator to consume the values delivered. If no values are being delivered, production of values will halt after all inital "degree" batches have been produced.
  
  When the deliverer is done with a result batch, it removes all available statistics information and adds these to the `stats` of the `ParaSeq` object. It also uses this information to calculate an optimum batch size for any other batches to be processed (unless this is inhibited by the `:!auto` named argument to `.&hyperize`).
  
  The algorithm for batch size calculation is pretty simple at the moment. To allow for optimum responsiveness of the program, as well as any other processes running on the computer, a time slice of 1\_000\_000 nanoseconds (aka 1 millisecond) has been chosen.
  
  If a batch took almost exactly that amount of time to produce values, then the size of that batch is assumed to be the optimum size. If the batch took longer, then the batch size should be reduced. If the batch took less than that to complete, then the batch size should be increased.
  
  ## Decision tree
  
  ```
    source
     \- hyperize
         |- invocant (degree == 1)
         |- Seq      (source exhausted with initial batch)
         |- ParaSeq
             \- method call
                 |- endpoint
                 |- coercer
                 |- hypering
  
  ```
  
  ## Hypering control flow
  
  ```
      /---------------------------------------------------------\
      |                |                                        |
      |               ⬇                                         |
      |         --------------                 ------------     |
      |         | statistics |         /-----⮕ | producer | ⮕ -|
      |         --------------        /        ------------     |
      ⬇               ⬇             /                          |
  -----------    ------------    -----------   ------------     |
  | results | ⮕ | deliverer | ⮕ | batcher | ⮕ | producer | ⮕ -|
  -----------    ------------    -----------   ------------     |
                      |              \                          |
                      |               \        ------------     |
                      |                \-----⮕ | producer | ⮕ -/
                      ⬇                        ------------
                   values
            consumed by program
  
  ```
  
  # AUTHOR
  
  Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)
  
  Source can be located at: <https://github.com/lizmat/ParaSeq> . Comments and Pull Requests are welcome.
  
  If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!
  
  # COPYRIGHT AND LICENSE
  
  Copyright 2024 Elizabeth Mattijsen
  
  This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.
  