Hi Philip, Colin, Chris, Matthias, Kirk, David, Xiangyuan LI,
KIP-944 was extended a bit more to explain why effect systems like Zio
and Cats-effects make it impossible to run code on a specific thread.
I understand that using an effect system is pretty far removed from
writing Java in transaction script style, the style that is probably
used by most Kafka committers. I took me quite some time to get
comfortable with effects. It is not the academic fringe tool as
perceived by many. For me it is a way to quickly and correctly write
serious data processing applications.
Even so, we both use the same Kafka eco-system and supporting different
styles only makes it more rich. IMHO it would be a shame if we can not
live together using the same code base.
Philip, thanks for your support. I hope I have convinced the others as
well by now. If not, I am giving up and I will spend my energy elsewhere.
Kind regards,
Erik.
Op 24-07-2023 om 18:12 schreef Erik van Oosten:
Hello Xiangyuan LI,
I am not familiar with coroutines, nor with Kotlin. You will have to
work with the documentation:
https://kotlinlang.org/docs/coroutines-overview.html
However, I am familiar with Zio and Cats-effects (both Scala
libraries). In both Zio and Cats-effects one creates effects (aka
workflows) which are descriptions of a computation. For example, when
executing the Scala code `val effect = ZIO.attempt(println("Hello
world!"))` one creates only a description; it does not print anything
yet. The language to describe these effects is rich enough to describe
entire applications including things like concurrency. In fact, the
language is so rich, that it is the most convenient way that I know to
safely write highly concurrent and async applications. For many
developer teams the performance penalty (which is real but not big) is
worth it.
To execute a Zio or Cats effect one gives it to the runtime. The
runtime then schedules the work on one of the threads in its
thread-pool. Zio, nor Cats-effects supports running an effect on the
thread that manages the thread-pool.
I hope this clear enough.
Kind regards,
Erik.
Op 24-07-2023 om 05:21 schreef Xiangyuan LI:
Hi Erik:
I read KIP-944 and email list roughly, it seems most Java
developer not
familiar with the conception of "coroutine" so cannot imagine why
code of
one function without Thread.start() may run in separate threads and even
developer couldn't control it. Maybe you need a more elaborate
description
to demonstrate how coroutine code run.
Erik van Oosten <e.vanoos...@grons.nl.invalid> 于2023年7月23日周日
17:47写道:
--
Erik van Oosten
e.vanoos...@grons.nl
https://day-to-day-stuff.blogspot.com