Skip to content

Conversation

lillianberryfly
Copy link

let (data_tx, mut data_rx) = channel(512);

tokio::spawn(async move {
if !pms.ndjson {
Copy link
Member

Choose a reason for hiding this comment

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

I think we could do Accept: application/ndjson as a header. At least it's generally how content type is negotiated :)

I just invented that, but maybe there's a better mime type for that.


tokio::spawn(async move {
if !pms.ndjson {
if let Err(e) = tx.send_data(bytes::Bytes::from_static(b"[")).await {
Copy link
Member

Choose a reason for hiding this comment

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

It would be cleaner to implement a tokio_util::codec::{Encoder,Decoder} for this format!

I wouldn't hold back this PR for that though!

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.

2 participants