Skip to content

Commit 35e4b32

Browse files
committed
add a new global method CLEANUP for safe cleaning streams
1 parent 6e35d7b commit 35e4b32

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ global.DESTROY = function(stream) {
175175
framework_internal.destroyStream(stream);
176176
};
177177

178+
global.CLEANUP = function(stream, callback) {
179+
FINISHED(stream, function() {
180+
if (callback)
181+
callback();
182+
DESTROY(stream);
183+
});
184+
};
185+
178186
global.SUCCESS = function(success, value) {
179187

180188
var err;

0 commit comments

Comments
 (0)