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

Add divert? functions #237

Closed
bn-darindouglass-zz opened this issue Apr 2, 2020 · 1 comment
Closed

Add divert? functions #237

bn-darindouglass-zz opened this issue Apr 2, 2020 · 1 comment

Comments

@bn-darindouglass-zz
Copy link

Bringing in context from Slack:

Some background: for one of our kstreams apps we have a util function call divert? that'll push off a record if a given predicate is true (i.e. to a failure topic, etc):

(defn divert? [stream pred topic]
  (let [[divert-stream continue-stream] (j/branch stream [pred (constantly true])]
    (j/to divert-stream topic)
    continue-stream)

This abstraction, IMO, would feel really good in the library proper because it provides a useful layer on top of j/branch to handle what i'd think is a common use-case (again, failure topics, etc);

@mt3593
Copy link

mt3593 commented May 26, 2020

Looks like a dup of #238

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

No branches or pull requests

2 participants