-
Notifications
You must be signed in to change notification settings - Fork 241
Conversation
The handler will call the callback methods asynchronously to not reduce performance of the API. As the callback methods have default behavior, user may only implement the event they want.
Ask for event callback in Consul creation (optional). Create event handler in Consul and inject it in each client (using base client).
Http class becomes stateful (storing the event handler). Call the handler for each HTTP request with client name, method and query string. EventClient was not fully using Http, so use it (with wrappers when needed).
There is too much duplicated code here, clean it.
Test all methods Sync and Async for: - result because of the refactoring - events Also test consulResponse method.
Monitor cache stop/start, polling success/error.
@@ -0,0 +1,306 @@ | |||
package com.orbitz.consul.util; |
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.
OPT: break lines between Arrange/Act/Assert sections in tests when they are more than a couple of lines
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.
Done.
Please tell me if it meets your expectations.
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.
👌
Following review of @Zonkooo, splitting the Arrange/Act/Assert sections would enhance readability.
@@ -0,0 +1,306 @@ | |||
package com.orbitz.consul.util; |
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.
👌
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.
Too big to review efficiently. LGTM overall.
Monitor http request and cache events:
Users will be able to implement methods of the callback (only those interesting them) to add custom monitoring (logs, metrics, ...).