This repository was archived by the owner on Mar 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Streaming in download end point wrapper #12
Comments
@sharathkumaranbu can we offer functions for both? Streaming and in-memory? |
@cwdcwd Is in memory streaming required? Are we foreseeing any use case? |
I don't want to break any existing systems using the module. we can deprecate it over time if need be |
Fine. Should we create separate function then? |
I think we can reuse the same function with a parameter to switch between buffer and stream. By default it will return buffer so existing modules won't be affected and we can modify the parameter to return stream. |
I'm good with that. let's make sure all this is documented too |
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
@cwdcwd @sharathkumaranbu Please go through #13 and topcoder-archive/topcoder-platform-topcoder-cli#23, and let me know if you need anything changed. |
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
dhruvit-r
added a commit
to dhruvit-r/topcoder-submission-api-wrapper
that referenced
this issue
Dec 6, 2019
Merged
sharathkumaranbu
pushed a commit
that referenced
this issue
Dec 6, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We have a wrapper for downloading submissions and artifacts from the Submission API. Right now what is being done is the wrapper is holding the entire contents in memory and creating a buffer and later receiving entire file it is passing the buffer to the caller but this is not a feasible approach while downloading bigger files. It will throttle system memory.
https://github.com/topcoder-platform/topcoder-submission-api-wrapper/blob/develop/src/common/helper.js#L170-L190
I believe we just need to pass the stream from the API to the caller, so that the caller can directly stream it to a file, instead of taking entire buffer and writing it to the file.
This would affect Topcoder CLI which is used to download submission and artifacts.
Makes sense?
@callmekatootie @cwdcwd
The text was updated successfully, but these errors were encountered: