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

Best way to write recursive Array Frames to the socket? #149

Open
louismlb opened this issue Oct 22, 2024 · 1 comment
Open

Best way to write recursive Array Frames to the socket? #149

louismlb opened this issue Oct 22, 2024 · 1 comment

Comments

@louismlb
Copy link

I don't know where the best place to ask this is,

but I was wondering what would be required to support writing recursive data structures asynchronously to the socket, like mentioned here. Should we make the write_frame method synchronous, and use tokio channels with synchronous methods on the sender? But then maybe it could get filled up if IO is slow?

Then what would be the most efficient / idiomatic way to tackle this?

That would allow support for sending array frames containing array frames, which is frequent in redis. I'd be glad to submit a PR if it is deemed useful for the tutorial repo.

@Darksonn
Copy link
Collaborator

Darksonn commented Oct 22, 2024

The cleanest way to do it would be to rewrite it to use tokio_util::codec, which doesn't have these challenges. Another option is to use boxing to allow recursion.

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