I have a requirement for my RXJS stream to process chunks of data in 250 millisecond intervals when the page is not visible. Chrome is throttling these intervals to 1000 millisecond intervals. To get around this I have implemented a AsyncAction that uses setInterval within a web worker. I am using it as follows:
export const customScheduler = new AsyncScheduler(WebWorkerAsyncAction)
However, this has not been without problems. When compiling this using JIT it works fine. When compiling it with AOT (another project requirement) It works for the first compilation however every second compilation there after fails with the following error:
ERROR in : Error: Could not resolve ./ from /node_modules/rxjs/internal/scheduler/AsyncScheduler.d.ts at TsCompilerAotCompilerTypeCheckHostAdapter.fromSummaryFileName (\node_modules@angular\compiler-cli\src\transformers\compiler_host.js:272:23) at AotSummaryResolver.fromSummaryFileName (\node_modules@angular\compiler\bundles\compiler.umd.js:26320:30) at \node_modules@angular\compiler\bundles\compiler.umd.js:24481:126 at Array.map () at FromJsonDeserializer.deserialize (\node_modules@angular\compiler\bundles\compiler.umd.js:24481:41) at deserializeSummaries (\node_modules@angular\compiler\bundles\compiler.umd.js:24086:29) at AotSummaryResolver._loadSummaryFile (\node_modules@angular\compiler\bundles\compiler.umd.js:26370:26) at AotSummaryResolver.resolveSummary (\node_modules@angular\compiler\bundles\compiler.umd.js:26328:22) at ToJsonSerializer.loadSummary (\node_modules@angular\compiler\bundles\compiler.umd.js:24310:48) at ToJsonSerializer.visitStaticSymbol (\node_modules@angular\compiler\bundles\compiler.umd.js:24285:32) at ToJsonSerializer.visitOther (\node_modules@angular\compiler\bundles\compiler.umd.js:24250:34) at visitValue (\node_modules@angular\compiler\bundles\compiler.umd.js:2438:24) at \node_modules@angular\compiler\bundles\compiler.umd.js:2451:54 at Array.map () at ToJsonSerializer.ValueTransformer.visitArray (\node_modules@angular\compiler\bundles\compiler.umd.js:2451:24) at visitValue (\node_modules@angular\compiler\bundles\compiler.umd.js:2429:28)
I assume that this is a quirk of using 'internal' RXJS packages but I can't see a way round this without relying on AsyncHandler.