the LongRun class supports to execute long-running Google Apps Scripts. (A spin-off from GAS-Terminal)
Related article is here.
See the Test1.ts or Test2.ts to know how to use this class.
( If you want generated script files instead of the TypeScript files, see this folder )