Skip to content

Stream as an accepts/returns argument #35

@raymondfeng

Description

@raymondfeng

I'm trying to implement a 'download' remote method that will pipe a stream into http response. For example,

function download(..., cb) {
var in = fs.createReadStream('1.jpg', ...);
in.pipe(res);
}

There are a few options:

  1. Have the download function to callback with a ReadStream so that strong-remoting will pipe it into the response.
  2. Invent a way to declare req/res parameters so that strong-remoting can inject them for the method invocation.
  3. Make HTTP context accessible by calling Context.getCurrent().

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions