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

feat: batch publish #480

Merged
merged 3 commits into from
Jan 8, 2024
Merged

feat: batch publish #480

merged 3 commits into from
Jan 8, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jan 4, 2024

Description

  • Add batch option to publish() api and GossipSub option
  • When it's true, encode messages once and send to all peer, ignore cached control messages

cc @wemeetagain

Closes #344

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2024

Codecov Report

Attention: Patch coverage is 83.69565% with 15 lines in your changes missing coverage. Please review.

Project coverage is 81.37%. Comparing base (eb53ea9) to head (d360060).
Report is 22 commits behind head on master.

Files with missing lines Patch % Lines
src/index.ts 79.54% 9 Missing ⚠️
test/floodsub.spec.ts 86.20% 4 Missing ⚠️
src/stream.ts 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #480      +/-   ##
==========================================
- Coverage   81.38%   81.37%   -0.01%     
==========================================
  Files          48       48              
  Lines       12275    12335      +60     
  Branches     1292     1301       +9     
==========================================
+ Hits         9990    10038      +48     
- Misses       2285     2297      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@twoeths twoeths marked this pull request as ready for review January 4, 2024 06:31
@twoeths twoeths requested a review from a team as a code owner January 4, 2024 06:31
src/types.ts Outdated Show resolved Hide resolved
@wemeetagain wemeetagain merged commit c11b924 into master Jan 8, 2024
9 checks passed
@wemeetagain wemeetagain deleted the tuyen/publish_in_batch branch January 8, 2024 21:55
twoeths added a commit to twoeths/js-libp2p-gossipsub that referenced this pull request Jan 9, 2024
* feat: batch publish

* chore: add tests

* refactor: batchPublish option instead of batch
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.

Publish in batch
4 participants