ZJONSSON / parquetjs

fully asynchronous, pure JavaScript implementation of the Parquet file format
MIT License
34 stars 61 forks source link

Buffer reader refactor #83

Closed dopatraman closed 2 years ago

dopatraman commented 2 years ago

Goal

The purpose of this PR is to refactor BufferReader to be testable.

Description

I've split the logic that was contained in the private readSubqueue method into a number of "private" (in the JS sense) methods that are exposed to the test runner:

The public interface is still the same. One could imagine an interface definition as follows:

interface BufferReader {
    read: void
    processQueue: void
}

Maybe we can define this in a subsequent PR.

Notes

This PR solves a bug involving multiple callbacks that occurs on Node version 16+.