8000 pubsub: sink without order · Issue #895 · snowplow/enrich · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
pubsub: sink without order #895
Open
@oguzhanunlu

Description

@oguzhanunlu

Currently all enrich apps sink chunks in order but we don't need order for PubSub. We need order for Kinesis and Kafka.

val sinkAndCheckpoint: Pipe[F, List[(A, Result)], Unit] =
_.parEvalMap(env.streamsSettings.concurrency.sink)(chunk =>
for {
begin <- Clock[F].realTime
result <- sinkChunk(chunk.map(_._2), env).as(chunk.map(_._1))
end <- Clock[F].realTime
_ <- Logger[F].debug(s"Chunk of size ${chunk.size} sunk in ${end - begin}")
} yield result
)
.evalMap(env.checkpoint)

We should conditionally use parEvalMapUnordered for PubSub so that resource usage (CPU and mem) and throughput can improve. It is a matter of benchmarking to see how much improvement it'll bring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0