Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SDK-1546 evict transactional HTTP client connection pool#223

Merged
kleewho merged 2 commits intoSDK-1558pubnub/java:SDK-1558from
SDK-1546pubnub/java:SDK-1546Copy head branch name to clipboard
Nov 16, 2021
Merged

SDK-1546 evict transactional HTTP client connection pool#223
kleewho merged 2 commits intoSDK-1558pubnub/java:SDK-1558from
SDK-1546pubnub/java:SDK-1546Copy head branch name to clipboard

Conversation

@bartk
Copy link
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
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
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?

src/main/java/com/pubnub/api/managers/RetrofitManager.java Outdated Show resolved Hide resolved
kleewho
kleewho previously approved these changes Nov 10, 2021
Copy link
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
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
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.