Skip to content

SDK-1546 evict transactional HTTP client connection pool#223

Merged
kleewho merged 2 commits intoSDK-1558from
SDK-1546
Nov 16, 2021
Merged

SDK-1546 evict transactional HTTP client connection pool#223
kleewho merged 2 commits intoSDK-1558from
SDK-1546

Conversation

@bartk
Copy link
Copy Markdown
Contributor

@bartk bartk commented Nov 10, 2021

fix: Eviction of OkHttp connection pool after reestablishing connection (affects transactional calls).

this.basePathManager = new BasePathManager(initialConfig);
this.retrofitManager = new RetrofitManager(this);
this.listenerManager = new ListenerManager(this);
this.retrofitManager = new RetrofitManager(this);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had to change the order of initialisation here. Retrofit c-tor needs ListenerManager not to be null.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe pass listenerManager explicitly?

kleewho
kleewho previously approved these changes Nov 10, 2021
Copy link
Copy Markdown
Contributor

@kleewho kleewho left a comment

Choose a reason for hiding this comment

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

You can address my comments but seems good enough

@Override
public void status(@NotNull final PubNub pubnub, @NotNull final PNStatus pnStatus) {
if (pnStatus.getCategory() == PNStatusCategory.PNReconnectedCategory) {
Executors.newSingleThreadExecutor().execute(new Runnable() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't you think it could be better as a field? I mean the executor and here only executor.execute(...)?

this.basePathManager = new BasePathManager(initialConfig);
this.retrofitManager = new RetrofitManager(this);
this.listenerManager = new ListenerManager(this);
this.retrofitManager = new RetrofitManager(this);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe pass listenerManager explicitly?

@kleewho kleewho changed the base branch from master to SDK-1558 November 16, 2021 11:55
@kleewho kleewho merged commit e3e8b9f into SDK-1558 Nov 16, 2021
@kleewho kleewho deleted the SDK-1546 branch November 16, 2021 11:58
kleewho added a commit that referenced this pull request Nov 17, 2021
@kleewho kleewho restored the SDK-1546 branch November 17, 2021 15:26
kleewho added a commit that referenced this pull request Nov 18, 2021
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