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

Support size check when adding multiple records into set #122

Open
zyiou opened this issue Dec 17, 2020 · 3 comments
Open

Support size check when adding multiple records into set #122

zyiou opened this issue Dec 17, 2020 · 3 comments

Comments

@zyiou
Copy link
Contributor

zyiou commented Dec 17, 2020

Is your feature request related to a problem? Please describe.
Currently we only support size check before sending the message, but adding multiple records to set will also cause size excess. We should make sure the set size is under size limit when adding records.

Describe the solution you'd like
Solution 1:

  • add record to set, check current length and length difference
  • if current length exceeds limit, revert set buffer by length difference

Solution 2:

  • build the record from element list
  • provide method to add record directly to set and check the size
  • if total length exceeds limit, return error
@srikartati
Copy link
Contributor

Prefer Solution 2. This will make it easier for user to consume the library.

I think we should essentially provide an interface that takes in element list with values, and inside the interface, we should create/build the record, maintain the set and send the set when appropriate. In addition, we should also add the capability to send the set immediately with a boolean.

Maintaining sets may not be straightforward. We need to maintain sets for different template IDs, and both for template and data sets.

And better to design this in such a way that it will be easy to extend support for multiple sets.

Considering the above may be a short description of design consideration is better, so that we will not miss some essential things.

@srikartati
Copy link
Contributor

@yiou: Is Issue #55 a duplicate of this issue? If so, please close that one.

@zyiou
Copy link
Contributor Author

zyiou commented Feb 18, 2021

@yiou: Is Issue #55 a duplicate of this issue? If so, please close that one.

Yes, they are duplications. Closing that.

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

No branches or pull requests

2 participants