MCPcopy Create free account
hub / github.com/nodejs/nan / StreamProgressWorker

Function StreamProgressWorker

test/js/asyncprogressqueueworkerstream-test.js:21–33  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

19 Readable = require('stream').Readable
20
21function StreamProgressWorker(t) {
22 Readable.call(this, {objectMode: true})
23 var self = this
24 // initialize stream from cpp on next tick
25 process.nextTick(function () {
26 var worker = bindings.doProgress
27 worker(5, function(i) {
28 self.push(i)
29 }, function () {
30 self.push(null)
31 })
32 })
33}
34util.inherits(StreamProgressWorker, Readable)
35
36StreamProgressWorker.prototype._read = function (data) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected