constructor ({
    reactive = false,
    moreFunction,
    discardFunction,
    fetchSize = FETCH_ALL,
    beforeError,
    afterError,
    beforeKeys,
    afterKeys,
    beforeComplete,
    afterComplete,
    server,
    highRecordWatermark = Number.MAX_VALUE,
    lowRecordWatermark = Number.MAX_VALUE,
    enrichMetadata,
    onDb
  } = {}) {
    super()

    this._fieldKeys = null
    this._fieldLookup = null
    this._head = null
    this._queuedRecords = []
    this._tail = null
    this._error = null
    this._observers = []
    this._meta = {}
    this._server = server

    this._beforeError = beforeError
    this._afterError = afterError
    this._beforeKeys = beforeKeys
    this._afterKeys = afterKeys
    this._beforeComplete = beforeComplete
    this._afterComplete = afterComplete
    this._enrichMetadata = enrichMetadata || functional.identity

    this._queryId = null
    this._moreFunction = moreFunction
    this._discardFunction = discardFunction
    this._discard = false
    this._fetchSize = fetchSize
    this._lowRecordWatermark = lowRecordWatermark
    this._highRecordWatermark = highRecordWatermark
    this._setState(reactive ? _states.READY : _states.READY_STREAMING)
    this._setupAutoPull()
    this._paused = false
    this._pulled = !reactive
    this._haveRecordStreamed = false
    this._onDb = onDb
  }
@param {Object} param
@param {Object} param.server
@param {boolean} param.reactive
@param {function(stmtId: number|Integer, n: number|Integer, observer: StreamObserver)} param.moreFunction -
@param {function(stmtId: number|Integer, observer: StreamObserver)} param.discardFunction -
@param {number|Integer} param.fetchSize -
@param {function(err: Error): Promise|void} param.beforeError -
@param {function(err: Error): Promise|void} param.afterError -
@param {function(keys: string[]): Promise|void} param.beforeKeys -
@param {function(keys: string[]): Promise|void} param.afterKeys -
@param {function(metadata: Object): Promise|void} param.beforeComplete -
@param {function(metadata: Object): Promise|void} param.afterComplete -
@param {function(metadata: Object): Promise|void} param.enrichMetadata -