Skip to content
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

feat: change streams.Task interface and update to v7 #111

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Skandalik
Copy link
Contributor

@Skandalik Skandalik commented Nov 1, 2023

Changes made here:

  • task.OnError now accepts function signature func(error) error, allowing to handle errors throughout the stream better than before.
    • By default error is returned further and task is stopped
    • It's up to developer's decision to stop the task, depending on the type of error for example. Task is going to be stopped only if error is returned from OnError.
  • updated Shopify/sarama to IBM/sarama with kafka tests updates
  • removed cache package as it had deprecated pkg/v4 as dependency, currently there's we have no time to reimplement cache sink, therefore it's removed in v7
  • removed sql package as it had data race related with database/sql usage. Hopefully we will be able to bring it back in the future.
  • removed xerrors dependency
  • general dependencies update
  • fixed data race in kafka sink related with errors

p.errFn(err)

return
if err = p.errFn(err); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I see here is Unlock function call is now optional but I guess its intended. The other difference is the p.errFn is now called before p.Unlock. Good, as long as you know its ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, previously p.Unlock has been called before errFn, but we were always stopping the task. Currently task is supposed to continue running until you return an error from errFn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants