-
Notifications
You must be signed in to change notification settings - Fork 22
limit batchsize #138
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
limit batchsize #138
Conversation
memphis/memphis.py
Outdated
| if not self.is_connection_active: | ||
| raise MemphisError("Connection is dead") | ||
| if batch_size > self.MAX_BATCH_SIZE: | ||
| raise MemphisError(f"Batch size parameter should be with value of {self.MAX_BATCH_SIZE} maximum!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the message to be as I write in the js sdk comments
memphis/memphis.py
Outdated
| if not self.is_connection_active: | ||
| raise MemphisError("Cant fetch messages without being connected!") | ||
| if batch_size > self.MAX_BATCH_SIZE: | ||
| raise MemphisError(f"Batch size parameter should be with value of {self.MAX_BATCH_SIZE} maximum!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the message to be as I write in the js sdk comments
| except Exception as e: | ||
| await self.dls_callback_func([], MemphisError(str(e)), self.context) | ||
| return | ||
| if self.dls_callback_func != None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why you did it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you call to Fetch function, you dont pass callback parameter. you can pass only batch_size parameter. there is function calls __consume_dls which run when the sdk start. when i put the raise error of the batch_size in Fetch function, the consume_dls function fall and go the the execpt where the callback is called. but in Fetch function there is not callback function so the code is fail. i put this if to check if there is a callback function to avoid this situation .
memphis/consumer.py
Outdated
| if self.connection.is_connection_active: | ||
| try: | ||
| if batch_size > self.MAX_BATCH_SIZE: | ||
| raise MemphisError(f"Batch size parameter should be with value of {self.MAX_BATCH_SIZE} maximum!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the message to be as I write in the js sdk comments
No description provided.