-
Notifications
You must be signed in to change notification settings - Fork 3.6k
str feat: RestartSourceWithContext #32178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
…kka into restart-source-with-context
johanandren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, let's keep it aligned then 👍
johanandren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.