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

Refactor buffering and clean up writes #61

Merged
merged 5 commits into from Apr 8, 2024
Merged

Refactor buffering and clean up writes #61

merged 5 commits into from Apr 8, 2024

Conversation

piotrpio
Copy link
Contributor

@piotrpio piotrpio commented Apr 5, 2024

  • Refactor BatchBuffer to utilize NIOLockedValueBox for simplified locking with separate State struct
  • Remove ClientOp.asBytes and instead use extension of ByteBuffer for writing messages to buffer

Thanks for the help @Lukasa!

Signed-off-by: Piotr Piotrowski piotr@synadia.com

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio requested review from mtmk and Jarema April 5, 2024 10:24
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Contributor

@mtmk mtmk left a comment

Choose a reason for hiding this comment

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

LGTM after the change to write() below

Sources/Nats/BatchBuffer.swift Show resolved Hide resolved
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Copy link
Contributor

@mtmk mtmk left a comment

Choose a reason for hiding this comment

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

LGTM

@piotrpio piotrpio merged commit f8ec29e into main Apr 8, 2024
3 checks passed
@piotrpio piotrpio deleted the improve-buffer branch April 8, 2024 13:54
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.

None yet

2 participants