Skip to content

Commit

Permalink
Removed all references to Ack in docs (#1043)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhungerford authored Jan 21, 2025
1 parent aa015e0 commit 32615a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
5 changes: 2 additions & 3 deletions kyo-prelude/shared/src/main/scala/kyo/Emit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ object Emit:
* @param acc
* The initial accumulator value
* @param f
* The folding function that takes the current accumulator and emitted value, and returns a tuple of the new accumulator and an
* Ack to control further emissions
* The folding function that takes the current accumulator and emitted value, and returns an updated accumulator
* @param v
* The computation with Emit effect
* @return
Expand Down Expand Up @@ -147,7 +146,7 @@ object Emit:
* @return
* A tuple containing:
* - Maybe[V]: The first emitted value if any (None if no values were emitted)
* - A continuation function that takes an Ack and returns the remaining computation
* - A continuation function that returns the remaining computation
*/
def apply[A: Flat, S](v: A < (Emit[V] & S))(using tag: Tag[Emit[V]], frame: Frame): (Maybe[V], () => A < (Emit[V] & S)) < S =
ArrowEffect.handleFirst(tag, v)(
Expand Down
18 changes: 6 additions & 12 deletions kyo-prelude/shared/src/main/scala/kyo/Poll.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ import kyo.kernel.ArrowEffect

/** Represents polling values from a data source with backpressure control.
*
* Poll is used to consume values while maintaining flow control through acknowledgements. Each poll operation takes an Ack that determines
* how many values can be consumed, and returns Maybe[V] indicating whether a value was available.
*
* Key behaviors:
* - Each poll operation requires an Ack value that signals the consumer's readiness to receive more data
* * Key behaviors:
* - Poll returns Maybe[V], where:
* - Present(v) indicates a successful poll with value v
* - Absent indicates the end of the stream (no more values will be available)
* - Once Absent is received, the consumer should stop polling as the stream has terminated
* - Backpressure is maintained through the Ack responses:
* - Continue signals readiness to receive more values
* - Stop indicates the consumer wants to pause receiving values
* Poll is used to consume values. Each poll operation signals readiness to receive data, and returns Maybe[V] indicating whether a value
* was available.
*
* The effect enables building streaming data pipelines with controlled consumption rates. Handlers can process values at their own pace by
* returning appropriate Ack responses, while respecting stream termination signals.
* polling only as needed.
*
* @tparam V
* The type of values being polled from the data source.
Expand Down Expand Up @@ -152,9 +147,8 @@ object Poll:

/** Runs a Poll effect with a single input value, stopping after the first poll operation.
*
* This method provides a single input value to the Poll effect and stops after the first poll. It returns a tuple containing:
* - An Ack value indicating whether to continue or stop
* - A continuation function that can process the Maybe[V] result of the poll
* This method provides a single input value to the Poll effect and stops after the first poll. It returns a continuation function
* that can process the Maybe[V] result of the poll
*
* @param v
* The computation requiring Poll values
Expand Down

0 comments on commit 32615a0

Please sign in to comment.