str feat: RestartSourceWithContext#32178
Conversation
c40f32f to
2d0ef75
Compare
|
Weird, I can't even get |
2d0ef75 to
565e052
Compare
|
Close/reopening for CI |
565e052 to
35b962f
Compare
johanandren
left a comment
There was a problem hiding this comment.
Looks good, needs Java APIs
akka-stream/src/main/scala/akka/stream/scaladsl/RestartSourceWithContext.scala
Outdated
Show resolved
Hide resolved
…ithContext.scala Co-authored-by: Johan Andrén <johan@markatta.com>
…kka into restart-source-with-context
johanandren
left a comment
There was a problem hiding this comment.
One more thing then I think this is ready to go.
| */ | ||
| def withBackoff[T, C]( | ||
| settings: RestartSettings, | ||
| sourceFactory: Creator[SourceWithContext[T, C, _]]): SourceWithContext[T, C, NotUsed] = { |
There was a problem hiding this comment.
The akka.japi.function interfaces are parallel with the JDK stdlib ones but add the capability to throw checked, for example for usage in actor message handling. That's not important here, so let's go with java.util.function.Supplier instead.
There was a problem hiding this comment.
Only used Creator to mirror the other Restart* factories... suppose there should be an issue to move those to Supplier (which would be binary incompat, but source compat) in 2.10?
There was a problem hiding this comment.
Ah, yes, let's keep it aligned then 👍
SourceWithContextcannot be wrapped into aRestartSource.I would assume that similar limitations apply to
SinkWithContext/FlowWithContext, but it's not clear how well their respective limitations with respect to dropping on restart mesh with the intended use of the...WithContextvariations for carrying something like a Kafka or Projection offset, which tend to be where an at-least-once guarantee is desired.