mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-22 01:22:21 +08:00
29 lines
589 B
JavaScript
29 lines
589 B
JavaScript
import { ReadableStream } from 'stream/web';
|
|
|
|
try {
|
|
let i = 0;
|
|
const writeable = new WritableStream({
|
|
start(controller) {
|
|
console.log('start');
|
|
},
|
|
write(chunk, con) {
|
|
console.log('write', chunk);
|
|
},
|
|
abort(reason) {
|
|
console.log('abort', reason);
|
|
},
|
|
});
|
|
|
|
// const write = writeable.getWriter();
|
|
await writeable.abort('1111');
|
|
// await write.write('111');
|
|
|
|
console.log('end--------');
|
|
|
|
// for await (const iterator of readableStream) {
|
|
// console.log(iterator);
|
|
// }
|
|
} catch (error) {
|
|
console.log('---end---', error);
|
|
}
|