★ wanayoo — archive 1999 https://github.com/segmentio/analytics-java/pull/162Nouvelle recherche | Portail wanayoo
Skip to content
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

Configurable max queue depth #162

Open
wants to merge 6 commits into
base: master
from

Conversation

@wadejensen
Copy link

@wadejensen wadejensen commented Feb 23, 2020

This PR allows for users to set a queueSize for the AnalyticsClient such that the maximum number of in messages buffered in memory / inflight is equal to queueSize + flushQueueSize.

Linked issue: #161

The compromise made here is that the default networkExecutor no longer queues message batches indefinitely, but rather blocks the looperExecutor until it has finished sending the previous message. Given that the default implementation is already blocking and single threaded, this does not feel like much of a regression.

The only issue I can see here is that it would be a bit confusing to anyone providing their own multi-threaded networkExecutor who did not realise that they must use a SynchronousQueue in order for the queueSize setting to work correctly.

@lubird lubird linked an issue that may be closed by this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

1 participant
You can’t perform that action at this time.