-
Notifications
You must be signed in to change notification settings - Fork 12
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
Handle or forward #11
Conversation
Making some changes towards better naming. Calling |
RequestForwarder => Router + other such renaming
Also fixed a bug in the Router Interceptor when forwarding request
override def onReady(): Unit = delegate.onReady() | ||
override def onMessage(incomingRequest: ReqT): Unit = { | ||
// TODO - Handle forwarding loop here | ||
if(routingStrategy.route.isDefinedAt(incomingRequest)) { |
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.
Not too sure how this helps.
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.
It helps when you don't want to forward certain kind of requests like health / ping. I know we can choose not to add this intercept for them, but I felt this also gives greater power in the hands of the developer. On the other hand it could also be deemed as confusing because of more than 2 ways to do the same thing. What do you think we should be doing?
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.
Alright. We should then use applyOrElse
as that seems a better way to do this (from the scaladoc)
Note that expression
pf.applyOrElse(x, default)
is equivalent to {{{ if(pf isDefinedAt x) pf(x) else default(x) }}} except thatapplyOrElse
method can be implemented more efficiently.
…Forward This will apply the intercepts in FIFO
Fixed the SuuchiClient's main method to put A=A... Z=Z and do a corresponding get against them
…of modified-only in scala compiler plugin
Current coverage is 58.90% (diff: 55.31%)@@ master #11 diff @@
==========================================
Files 11 14 +3
Lines 155 219 +64
Methods 0 0
Messages 0 0
Branches 26 34 +8
==========================================
+ Hits 81 129 +48
- Misses 68 81 +13
- Partials 6 9 +3
|
I think we should merge this branch soon. I've experimented too much stuff in here. I'm very very happy with how things have progressed so far 👍 |
Fixes #2
Early version of
HandleOrForward
based on aForwardStrategy
. Will integrate with Partitioner once #10 is merged.cc: @brewkode