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

basic implementation of comma-separated json #110

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lillianberryfly
Copy link

@@ -474,6 +481,13 @@ pub async fn api_v1_queries(
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.

@@ -474,6 +481,13 @@ pub async fn api_v1_queries(
let (data_tx, mut data_rx) = channel(512);

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