kopia lustrzana https://github.com/c9/core
17 wiersze
376 B
JavaScript
17 wiersze
376 B
JavaScript
module.exports = function (vfs, options, register) {
|
|
var Stream = require('stream');
|
|
|
|
var stream = new Stream();
|
|
stream.readable = true;
|
|
|
|
register(null, {
|
|
subscribe: function (callback) {
|
|
callback(null, { stream: stream });
|
|
},
|
|
|
|
publish: function(message) {
|
|
stream.emit("data", message);
|
|
}
|
|
});
|
|
};
|