From 093f2a3e1796b41a6705d3b41a5e96ee8717b560 Mon Sep 17 00:00:00 2001 From: John Hungerford Date: Tue, 21 Jan 2025 11:34:58 -0500 Subject: [PATCH 1/2] Removed all references to Ack in docs --- .../shared/src/main/scala/kyo/Emit.scala | 5 ++--- .../shared/src/main/scala/kyo/Poll.scala | 21 +++++-------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/kyo-prelude/shared/src/main/scala/kyo/Emit.scala b/kyo-prelude/shared/src/main/scala/kyo/Emit.scala index c0e189257..2d8722b62 100644 --- a/kyo-prelude/shared/src/main/scala/kyo/Emit.scala +++ b/kyo-prelude/shared/src/main/scala/kyo/Emit.scala @@ -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 @@ -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)( diff --git a/kyo-prelude/shared/src/main/scala/kyo/Poll.scala b/kyo-prelude/shared/src/main/scala/kyo/Poll.scala index fa0e59ea5..2b3a4e96e 100644 --- a/kyo-prelude/shared/src/main/scala/kyo/Poll.scala +++ b/kyo-prelude/shared/src/main/scala/kyo/Poll.scala @@ -4,21 +4,11 @@ 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 - * - 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. @@ -152,9 +142,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 From 906d839e6c46aa55541b840a1ffab5bbed0e4c73 Mon Sep 17 00:00:00 2001 From: John Hungerford Date: Tue, 21 Jan 2025 13:54:41 -0500 Subject: [PATCH 2/2] Restored key behaviors to Poll scaladoc --- kyo-prelude/shared/src/main/scala/kyo/Poll.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kyo-prelude/shared/src/main/scala/kyo/Poll.scala b/kyo-prelude/shared/src/main/scala/kyo/Poll.scala index 2b3a4e96e..60f8541f0 100644 --- a/kyo-prelude/shared/src/main/scala/kyo/Poll.scala +++ b/kyo-prelude/shared/src/main/scala/kyo/Poll.scala @@ -4,6 +4,11 @@ import kyo.kernel.ArrowEffect /** Represents polling values from a data source with backpressure control. * + * * 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 * Poll is used to consume values. Each poll operation signals readiness to receive data, and returns Maybe[V] indicating whether a value * was available. *