Skip to content

Commit 3c6eb8d

Browse files
committed
Move class to inner to avoid compat problems
1 parent 80b8926 commit 3c6eb8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/ox/flow/FlowOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,6 @@ class FlowOps[+T]:
677677
*/
678678
def groupedWithin(n: Int, duration: FiniteDuration)(using BufferCapacity): Flow[Seq[T]] = groupedWeightedWithin(n, duration)(_ => 1)
679679

680-
private case class GroupingTimeout(generation: Long)
681-
682680
/** Chunks up the emitted elements into groups, within a time window, or limited by the cumulative weight being greater or equal to the
683681
* `minWeight`, whatever happens first. The timeout is reset after a group is emitted. If timeout expires and the buffer is empty,
684682
* nothing is emitted. As soon as a new element is received, the flow will emit it as a single-element group and reset the timer.
@@ -691,6 +689,8 @@ class FlowOps[+T]:
691689
* The function that calculates the weight of an element.
692690
*/
693691
def groupedWeightedWithin(minWeight: Long, duration: FiniteDuration)(costFn: T => Long)(using BufferCapacity): Flow[Seq[T]] =
692+
case class GroupingTimeout(generation: Long)
693+
694694
require(minWeight > 0, "minWeight must be > 0")
695695
require(duration > 0.seconds, "duration must be > 0")
696696

0 commit comments

Comments
 (0)