Skip to content

Event publishing for LoadBalancer #218

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

Merged
merged 2 commits into from
Jan 9, 2017

Conversation

NiteshKant
Copy link
Contributor

Problem

No events are published for LoadBalancer

Modification

Publishing events for LoadBalancer

Result

More events, more insight!

__Problem__

No events are published for `LoadBalancer`

__Modification__

Publishing events for `LoadBalancer`

__Result__

More events, more insight!
@NiteshKant NiteshKant requested a review from stevegury January 9, 2017 17:04
lastRefresh = now;
addSockets(1);
if (eventListener != null) {
eventListener.socketsRefreshCompleted(Clock.elapsedSince(now), Clock.unit());
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be better moved inside addSocket, since the addSocket action is asynchronous.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Discussed offline)
It is more involved to emit this event after the addSocket is finished. This event is more useful to indicate that socket refresh is happening, latency of connect can be useful in determining latency of refresh.

@@ -204,17 +223,17 @@ public LoadBalancer(Publisher<? extends Collection<ReactiveSocketClient>> factor

private synchronized void addSockets(int numberOfNewSocket) {
int n = numberOfNewSocket;
if (n > activeFactories.size()) {
n = activeFactories.size();
if (n > activeFactories.holder.size()) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not adding a size method in ActiveList?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@NiteshKant
Copy link
Contributor Author

@sgury I have addressed your comments.

@NiteshKant NiteshKant merged commit 39ea5b6 into rsocket:0.5.x-events Jan 9, 2017
@NiteshKant NiteshKant deleted the 0.5.x-events-lb branch January 9, 2017 22:11
NiteshKant added a commit that referenced this pull request Jan 9, 2017
* Event publishing for `LoadBalancer`

__Problem__

No events are published for `LoadBalancer`

__Modification__

Publishing events for `LoadBalancer`

__Result__

More events, more insight!
ilayaperumalg pushed a commit to ilayaperumalg/rsocket-java that referenced this pull request Dec 26, 2017
Replacing the dangling reference to LEASE_ERROR and replacing with REJECTED
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.

3 participants