Skip to content

Codec support for writer #198

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 5 commits into from
Mar 7, 2023
Merged

Codec support for writer #198

merged 5 commits into from
Mar 7, 2023

Conversation

rekby
Copy link
Member

@rekby rekby commented Mar 6, 2023

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

@rekby rekby linked an issue Mar 6, 2023 that may be closed by this pull request
@rekby rekby changed the base branch from main to v3 March 6, 2023 22:08
@rekby rekby closed this Mar 6, 2023
@rekby rekby reopened this Mar 6, 2023
@rekby rekby force-pushed the 134-support-codecs-to-writer branch 3 times, most recently from 1400ae5 to dfb2af4 Compare March 6, 2023 22:53
@rekby rekby force-pushed the 134-support-codecs-to-writer branch from dfb2af4 to 3902748 Compare March 6, 2023 22:55
@rekby rekby force-pushed the 134-support-codecs-to-writer branch from 95d007b to 1104d9d Compare March 7, 2023 08:59
self._messages_future.extend(messages_future)

for m in internal_messages:
self._new_messages.put_nowait(m)
if self._codec == PublicCodec.RAW:
Copy link
Member Author

Choose a reason for hiding this comment

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

If need encode message - send it to encode loop, else - direct add to send queue.

encode_waiters = []
encoder_function = self._codec_functions[codec]

for message in messages:
Copy link
Member Author

Choose a reason for hiding this comment

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

start encode messages in parallel

self._codec_selector_batch_num += 1
return codec

async def _get_available_codecs(self) -> List[PublicCodec]:
Copy link
Member Author

Choose a reason for hiding this comment

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

Get allowed codec from server and intersect it with supported codecs with encoders map.

If server side has no codec restriction - use raw and gzip only (for better compatibility with readers).

@rekby rekby marked this pull request as ready for review March 7, 2023 09:29
@rekby rekby requested a review from Valeria1235 March 7, 2023 09:29
@rekby rekby force-pushed the 134-support-codecs-to-writer branch from fe741fa to ccc6eec Compare March 7, 2023 16:10
@rekby rekby merged commit b31efcb into v3 Mar 7, 2023
@rekby rekby deleted the 134-support-codecs-to-writer branch March 7, 2023 19:57
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.

Support codecs to writer
2 participants