Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jacobbubu/pull-high-watermark
https://github.com/jacobbubu/pull-high-watermark
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jacobbubu/pull-high-watermark
- Owner: jacobbubu
- License: mit
- Created: 2020-04-27T15:51:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:31:23.000Z (about 2 years ago)
- Last Synced: 2024-11-13T16:11:59.845Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 1.16 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# @jacobbubu/pull-high-watermark
[![Build Status](https://github.com/jacobbubu/pull-high-watermark/workflows/Build%20and%20Release/badge.svg)](https://github.com/jacobbubu/pull-high-watermark/actions?query=workflow%3A%22Build+and+Release%22)
[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/pull-high-watermark/badge.svg)](https://coveralls.io/github/jacobbubu/pull-high-watermark)
[![npm](https://img.shields.io/npm/v/@jacobbubu/pull-high-watermark.svg)](https://www.npmjs.com/package/@jacobbubu/pull-high-watermark/)> Rewritten [pull-high-watermark](https://github.com/pull-stream/pull-high-watermark) in TypeScript.
# pull-high-watermark
a pull stream that eagerly reads ahead until it has reached the watermark.
# example
if there is medium/heavy sync processing in the pipe line (say, parsing),
it may go faster if we ensure there is always something coming in the async part,We never want the io to be waiting for the parsing.
``` js
import { pull } from ('pull-stream')
import HighWatermark from '@jacobbubu/pull-high-watermark'pull(
asyncSource,
HighWatermark(10, 2), //go faster!
heavySyncProcessing(),
sink
)
```## HighWatermark(hwm, lwm[, group]) => through
read ahead at most to the high water mark (`hwm`) and at least to the low water mark (`lwm`)
`hwm` default to 10, and `lwm` defaults to 0.the `group` option indicates that the buffer should be emitted wholesale as an
array. this allows consumers to run batch operations on values, while avoiding
slowing down the upstream producer. defaults to `false`.## License
MIT