You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task will return a readable, writable, or duplex stream. However, then the user, if they are making mischief, can interfere. Perhaps there is a use case for this, and it should just be advised to be avoided to not use stream methods on the streams that Task returns. Consider:
constconfig={sraAccession: '2492428',referenceURL: 'http://ftp.ncbi.nlm.nih.gov/genomes/all/GCA_000988525.2_ASM98852v2/GCA_000988525.2_ASM98852v2_genomic.fna.gz'}// TODO take in an object stream to start off a bunch of theseconstdownloadReference=Task({input: config.referenceURL,output: newFile(config.referenceURL.split('/').pop())},({ input, output })=>request(input).pipe(fs.createWriteStream(output.value)))consts=downloadReference()s.write('FOOBAR')// This gets written to the reference.gz file (and corrupts it)s.on('finish',()=>console.log('File written'))
Moreover something to keep in mind; probably not worthwhile finding a way to enforce this cannot happen instead of just advising to users to not do it unless they know what they are doing.
The text was updated successfully, but these errors were encountered:
Task
will return a readable, writable, or duplex stream. However, then the user, if they are making mischief, can interfere. Perhaps there is a use case for this, and it should just be advised to be avoided to not use stream methods on the streams thatTask
returns. Consider:Moreover something to keep in mind; probably not worthwhile finding a way to enforce this cannot happen instead of just advising to users to not do it unless they know what they are doing.
The text was updated successfully, but these errors were encountered: