import { InertApp } from "@scramjet/types" ; type { InertApp } param { Readable } _stream param { number } kbytes param { number } timeout module . exports = async function ( _stream , kbytes , timeout ) { this . logger . info ( "Sequence called with: " , kbytes , timeout ) ; this . on ( "test-event" , ( ) => this . emit ( "test-event-response" , "message from sequence" ) ) ; let i = 0 ; while ( i < + kbytes ) { const isPlaceInBuffer = process . stdout . write ( Buffer . alloc ( 1024 , 0xdeadbeef ) ) ; if ( ! isPlaceInBuffer ) { this . emit ( "test-event-response" , "message from sequence" ) ; await new Promise ( res => setTimeout ( res , + timeout ) ) ; } i ++ ; } } as InertApp ;