apache / pekko

Build highly concurrent, distributed, and resilient message-driven applications using Java/Scala
https://pekko.apache.org/
Apache License 2.0
1.17k stars 141 forks source link

Deprecate `statefulMapConcat` #601

Closed He-Pin closed 1 year ago

He-Pin commented 1 year ago

Motivation:

As the statefulMapConcat not handing the upstreamFinished event, so when the stream is complete, the ongoing state ke eped in the closure can be lost.

I suggest we annotate that in the scaladoc and deprecate the usage, and infavor the statefulMap

As the tests in https://github.com/Kotlin/kotlinx.coroutines/pull/3868 shows and the origin Akka issue for `statefulMap: https://github.com/akka/akka/issues/31077

pjfanning commented 1 year ago

Is this something that can be done in Pekko 1.0.2? We should at least consider updating the Pekko 1.0 docs.

He-Pin commented 1 year ago

Can we deprecate things in the 1.0.x ?

pjfanning commented 1 year ago

Can we deprecate things in the 1.0.x ?

yes, we can deprecate code in 1.0.x

something like

@deprecated("This function has been replace by <otherFunctionName>", "1.0.2") (the 2nd string is the version number)

I would only deprecate in a patch release for something that is a bug and a fix is provided in an alternative function.