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

Add Streams API support to k6 #2978

Closed
3 tasks done
oleiade opened this issue Mar 13, 2023 · 1 comment
Closed
3 tasks done

Add Streams API support to k6 #2978

oleiade opened this issue Mar 13, 2023 · 1 comment
Assignees
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6

Comments

@oleiade
Copy link
Member

oleiade commented Mar 13, 2023

Problem Statement

The Streams API is a specification for JavaScript which aims to provide users with programmatically access streams of data and process them as desired by the developer. It was initially designed for networking and with the Fetch API in mind, however, in light of recent work made on both improving the handling of large files in k6 and our future HTTP API, it appears that it might be a good candidate to improve and streamline data consumption and manipulation in k6 too.

Proposal

We propose to provide a subset of the streams API as a k6 module, and expose it to both k6 internals as well as our public API. Judging by the scope of the Streams API itself, we propose that only ReadableStream would be implemented at first. If necessary at a later time, we could then implement support for writable and transformable streams too.

One of the main use case for streams as of this day would be around data processing, either from a file, or from a source in memory. It would likely allow us to consume data from various sources, without requiring to load it as a whole beforehand as it often is the case now.

Beyond the optimized resources consumption it would offer, we could also extend our existing APIs to have the ability to consume Streams. We believe beyond implementing and exposing streams to JavaScript user scripts, we would need to make sure our underlying API remains usable and intuitive from the Go side too to facilitate adoption from modules and extensions.

Problem space

Execution

Tasks

  1. enhancement
    joanlopez oleiade
  2. 10 of 12
    joanlopez oleiade
@andrewslotin
Copy link
Contributor

Closing as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6
Projects
Development

No branches or pull requests

3 participants