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

POC: support paging with streaming queries #96

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

Conversation

ryantxu
Copy link
Member

@ryantxu ryantxu commented Jun 30, 2021

We currently support paging by having the client submit additional requests over HTTP when a nextToken exists -- this PR explores how we could service the requests with a continuous stream from the backend. This uses the new live features in grafana 8

TODO?

  • should this be optional, or the standard way to support multiple pages?
  • this using the standard StreamingDataFrame processing -- do we need anything different?

rawQuery: first.meta?.executedQueryString,
nextToken: meta.nextToken,
} as TimestreamQuery;
// return {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is commented out so we avoid frontend paging in addition to backend paging


func (q *openQuery) doStream(ctx context.Context, sender *backend.StreamSender) error {
backend.Logger.Info("Starting stream for", "queryId", q.queryId, "token", q.query.NextToken)
timer := time.NewTimer(time.Second * 2)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure what interval makes the most sense -- since the query will block, something short seems reasonable

@ryantxu
Copy link
Member Author

ryantxu commented Jul 1, 2021

🤔 hymm -- thinking more about this... I don't think this solves our HA issue, since the initial query may be on a different node than when the client returns to get the streaming updates

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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