continuous-streams
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
{ | ||
"name": "continuous-streams", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"description": "Special purpose Node streams", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -5,3 +5,3 @@ # Continuous Streams | ||
* continuous reading, i.e., don't stop if there is temporarily no data available | ||
* continuous reading, i.e., it doesn't stop if there is temporarily no data available | ||
* configurable chunk size to read | ||
@@ -15,2 +15,3 @@ * specific error handling (error vs. skip/retry) | ||
[![Coverage Status](https://coveralls.io/repos/github/frankthelen/continuous-streams/badge.svg?branch=main)](https://coveralls.io/github/frankthelen/continuous-streams?branch=main) | ||
[![Maintainability](https://api.codeclimate.com/v1/badges/d0f823493c0977615c21/maintainability)](https://codeclimate.com/github/frankthelen/continuous-streams/maintainability) | ||
[![node](https://img.shields.io/node/v/continuous-streams.svg)](https://nodejs.org) | ||
@@ -38,4 +39,4 @@ [![code style](https://img.shields.io/badge/code_style-airbnb-brightgreen.svg)](https://github.com/airbnb/javascript) | ||
reader.readData = async (count) => { | ||
// read `count` items from resource (result can be empty []) | ||
// if rejects, a `skip` event will be emitted | ||
// read `count` items from resource (can be empty []) | ||
// if rejects, a `skip` event is emitted (unless `skipOnError` is `false`) | ||
return items; // array of data items | ||
@@ -49,3 +50,3 @@ }; | ||
// process a single data item | ||
// if rejects, a `skip` event will be emitted | ||
// if rejects, a `skip` event is emitted (unless `skipOnError` is `false`) | ||
}; | ||
@@ -89,7 +90,7 @@ | ||
* `skip` - When reading from the underlying resource failed (if `skipOnError` is `true`). The stream continues to read after a delay of `waitAfterError`. Example: `reader.on('skip', ({ error }) => { ... })`. | ||
* `error` - When reading from the underlying resource failed (if `skipOnError` is `false`). If the pipeline was started with `pipeline()`, the pipeline will stop. If the pipeline was started with `pipe()`, it will continue processing -- an error handler must be provided though. Example: `reader.on('error', (error) => { ... })`. | ||
* `skip` - When reading from the underlying resource failed (if `skipOnError` is `true`). The stream continues to read after a delay of `waitAfterError`. Example handler: `reader.on('skip', ({ error }) => { ... })`. | ||
* `error` - When reading from the underlying resource failed (if `skipOnError` is `false`). If the pipeline was started with `pipeline()`, the pipeline will stop. If the pipeline was started with `pipe()`, it will continue processing -- an error handler must be provided though. Example handler: `reader.on('error', (error) => { ... })`. | ||
* `end` - When `stop()` was called for gracefully shutting down the pipeline. | ||
* `close` - When the stream is closed (as usual). | ||
* `debug` - After each successful reading attempt providing some debug information. Example: `reader.on('debug', ({ items, requested, total }) => { ... })`. | ||
* `debug` - After each successful reading attempt providing some debug information. Example handler: `reader.on('debug', ({ items, requested, total, elapsed }) => { ... })`. | ||
@@ -117,7 +118,7 @@ ### `ContinuousWriter` | ||
* `skip` - If `skipOnError` is `true` (default). Example: `writer.on('skip', ({ data, error }) => { ... })`. | ||
* `skip` - If `skipOnError` is `true` (default). Example handler: `writer.on('skip', ({ data, error }) => { ... })`. | ||
* `error` - If `skipOnError` is `false`. The pipeline will stop. | ||
* `finish` - After graceful shutdown and all asynchronous write operations are returned. | ||
* `close` - After `error` or `finish` (as usual). | ||
* `debug` - After each successful write operation providing some debug information. Example: `writer.on('debug', ({ inflight, total }) => { ... })`. | ||
* `debug` - After each successful write operation providing some debug information. Example handler: `writer.on('debug', ({ inflight, total, elapsed }) => { ... })`. | ||
@@ -144,5 +145,5 @@ ### `ContinuousTransformer` | ||
* `skip` - If `skipOnError` is `true` (default). Example: `transformer.on('skip', ({ data, error }) => { ... })`. | ||
* `skip` - If `skipOnError` is `true` (default). Example handler: `transformer.on('skip', ({ data, error }) => { ... })`. | ||
* `error` - If `skipOnError` is `false`. The pipeline will stop. | ||
* `close` - When the stream is closed (as usual). | ||
* `debug` - After each successful transform operation providing some debug information. Example: `transformer.on('debug', ({ inflight, total }) => { ... })`. | ||
* `debug` - After each successful transform operation providing some debug information. Example handler: `transformer.on('debug', ({ inflight, total, elapsed }) => { ... })`. |
require('./setup'); | ||
const { expect } = require('chai'); | ||
const FlightController = require('../src/FlightController'); | ||
describe('services/streams/FlightController', () => { | ||
describe('FlightController', () => { | ||
it('should set default values', () => { | ||
const fc = new FlightController(); | ||
expect(fc.limit).to.be.equals(10); | ||
}); | ||
it('should not call callback if limit is reached', () => { | ||
@@ -6,0 +12,0 @@ const fc = new FlightController({ limit: 2 }); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49709
19
1233
143
1