promisify.js
function promisify_read_stream() {
    var transformer = function (stream_promise) {
        var res = new PStream();
        res.to = function (dest) {
            when(stream_promise, function (stream) {
                PStream.wrap_read_stream(stream).to(dest);
            }, function (err) {
                dest.error(err);
            });
        };
        return res.sanitize();
    };

    transformer.for_property = function (obj_promise, prop) {
        return transformer(when(obj_promise, function (obj) {
            return obj[prop];
        }));
    };

    return transformer;
}
function promisify_read_stream() {
    var transformer = function (stream_promise) {
        var res = new PStream();
        res.to = function (dest) {
            when(stream_promise, function (stream) {
                PStream.wrap_read_stream(stream).to(dest);
            }, function (err) {
                dest.error(err);
            });
        };
        return res.sanitize();
    };

    transformer.for_property = function (obj_promise, prop) {
        return transformer(when(obj_promise, function (obj) {
            return obj[prop];
        }));
    };

    return transformer;
}
function promisify_read_stream ( ) { var transformer = function ( stream_promise ) { var res = new PStream ( ) ; res . to = function ( dest ) { when ( stream_promise , function ( stream ) { PStream . wrap_read_stream ( stream ) . to ( dest ) ; } , function ( err ) { dest . error ( err ) ; } ) ; } ; return res . sanitize ( ) ; } ; transformer . for_property = function ( obj_promise , prop ) { return transformer ( when ( obj_promise , function ( obj ) { return obj [ prop ] ; } ) ) ; } ; return transformer ; }
Takes a promised read stream and returns a PStream
Takes a promised read stream and returns a PStream