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

Introduced lifecycle for compression providers #284

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

merlimat
Copy link
Contributor

Motivation

Use individual instances of compression providers for each producer/consumer, with a defined lifecycle, instead of a static singleton instance.

Some compression implementation can use private state to improve the performance. Typically these need to be used by a single go-routine. For this, it's better to have private instances.

return nil, err
}

pc.compressionProviders[msgMeta.GetCompression()] = provider
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to close these providers when we the consumer is closed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's done at line 683 above

@merlimat merlimat merged commit d4c5dcc into apache:master Jun 18, 2020
@merlimat merlimat deleted the comp-lifecycle branch June 18, 2020 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants