-
Notifications
You must be signed in to change notification settings - Fork 279
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 support for secondary dispatching on LR2 #2069
Conversation
564b30d
to
27a1453
Compare
|
||
const secondaryCursorPrefix = "$$secondary:" | ||
|
||
func publishClient[Q requestMessageWithCursor, R responseMessageWithCursor](ctx context.Context, client receiver[R], stream dispatch.Stream[R], secondaryDispatchName string) error { |
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.
is Q
used anywhere?
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.
Its used for the type of the incoming message, off of which I grab the cursor. I could have the req just be that interface directly, but I always prefer well-typed wherever possible
internal/dispatch/remote/cluster.go
Outdated
|
||
// If no secondary dispatches are defined, just invoke directly. | ||
if len(cr.secondaryDispatchExprs) == 0 || len(cr.secondaryDispatch) == 0 { | ||
return publishClient[Q](withTimeout, client, stream, "") |
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.
define a constant for the primary dispatcher name?
Relation: "...", | ||
}, | ||
OptionalCursor: &v1.Cursor{ | ||
Sections: []string{secondaryCursorPrefix + "tertiary"}, |
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.
add one extra test case where the expression is "['secondary']"
and the cursor is also for secondary
?
27a1453
to
411479e
Compare
411479e
to
543e6e0
Compare
No description provided.