Feeding an Effect Queue with an Async Generator

Using async generator to feed a Queue

Hello, my purpose is to feed an Effect Queue using an async generator. So, actually, I can read the content line-by-line of a gzip file :

const readGzipFile = async function* (
  filePath: string,
): AsyncGenerator<string, void, unknown> {
  const fileStream = fs.createReadStream(filePath);
  const gunzip = zlib.createGunzip();
  const rl = readline.createInterface({
    input: fileStream.pipe(gunzip),
    crlfDelay: Infinity,
  });
  for await (const line of rl) yield line;
};


But how to use this function to effectively feed line-by-line an Effect Queue ?
Was this page helpful?