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

bug: apply max_messages and max_bytes parameters #365

Open
rekby opened this issue Oct 30, 2023 · 0 comments
Open

bug: apply max_messages and max_bytes parameters #365

rekby opened this issue Oct 30, 2023 · 0 comments
Labels
bug Something isn't working topic

Comments

@rekby
Copy link
Member

rekby commented Oct 30, 2023

Bug Report

YDB Python SDK version: 3.5.1

def receive_batch(
self,
*,
max_messages: typing.Union[int, None] = None,
max_bytes: typing.Union[int, None] = None,
timeout: Union[float, None] = None,
) -> Union[PublicBatch, None]:
"""

Example of calc size for a message:

def _split_messages_by_size_with_default_overhead(
messages: List[InternalMessage],
) -> List[List[InternalMessage]]:
def get_message_size(msg: InternalMessage):
return len(msg.data) + _message_data_overhead
return _split_messages_by_size(messages, connection._DEFAULT_MAX_GRPC_MESSAGE_SIZE, get_message_size)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic
Projects
None yet
Development

No branches or pull requests

1 participant