Skip to content

Something like a Broadcaster? #31

@mildsunrise

Description

@mildsunrise

I mean, an utility which gets a list of Writable streams as destinations,
then writes any data it recieves to every destination.

I run into this issue very often, especially when I want to stream some
live data into the client and record it in a file.

function streamLiveAudio(output) {
  // read audio from the device
  // and write it to "output".
}

http.createServer(function(req,res) {
  // write headers...

  var outfile = fs.createWriteStream('audio.raw', {flags: 'a'});
  var broadcaster = new Broadcaster(outfile, res);

  streamLiveAudio(broadcaster);
}).listen(3121);

It should also broadcast other events such as end.
This is the only utility I miss in Pipette. Excuse me if it's already present.

PD: Thumbs up, this is a _great module!_
I don't understand why it has so few watchers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions