@brigade/pooled-thrift-client
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -15,1 +15,12 @@ # Changelog | ||
- Fix babel compilation and include runtime for normal usage | ||
## 1.0.3 | ||
- Correctly release connections on error cases | ||
## 1.1.0 | ||
- Fix potential multi-release of pooled connections resulting in unhandled | ||
Promise rejections | ||
- Rework callback attach/detachment to eliminate edge cases | ||
- Remove Babel and go native ES6 to fix bug in transpiled code |
{ | ||
"name": "@brigade/pooled-thrift-client", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "A Thrift client utilising a pool of service connections and improved error handling/recovery", | ||
"main": "dist/index.js", | ||
"main": "src/index.js", | ||
"engines": { | ||
"node": ">= 6" | ||
}, | ||
"scripts": { | ||
"build": "babel src -d dist", | ||
"lint": "eslint .", | ||
"prepublish": "npm run build", | ||
"test": "jasmine" | ||
@@ -28,3 +29,2 @@ }, | ||
"dependencies": { | ||
"babel-runtime": "^6.26.0", | ||
"generic-pool": "^3.4.0", | ||
@@ -34,5 +34,2 @@ "thrift": "^0.11.0" | ||
"devDependencies": { | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.6.1", | ||
"eslint": "^4.13.1", | ||
@@ -39,0 +36,0 @@ "eslint-config-brigade": "^7.0.0", |
@@ -17,3 +17,3 @@ # pooled-thrift-client | ||
- faster detection and pruning of dead connections | ||
- async/await and other niceties | ||
- async/await compatibility and other niceties | ||
@@ -24,5 +24,7 @@ ## Example usage | ||
```thrift | ||
exception OutOfRange { | ||
1: string message | ||
} | ||
service CalculatorService { | ||
void ping(), | ||
i32 add(1:i32 num1, 2:i32 num2) | ||
i32 add(1:i32 num1, 2:i32 num2) throws (1:OutOfRange out_of_range) | ||
} | ||
@@ -38,4 +40,4 @@ ``` | ||
```js | ||
import CalculatorService from './CalculatorService'; | ||
import thriftClient, { AcquisitionTimeoutError, ConnectionTimeoutError } from 'pooled-thrift-client'; | ||
const CalculatorService = require('./CalculatorService'); | ||
const thriftClient = require('pooled-thrift-client'); | ||
@@ -49,1 +51,13 @@ // host and port are mandatory see other config options in comments | ||
``` | ||
## Testing | ||
Tests use the `calculator_service.thrift` example service located in | ||
`spec/support/thrift`. A compiled version is committed to this repository; to | ||
recompile it, install `thrift` using your package manager (e.g., `brew install | ||
thrift`), then follow the instructions in the file. | ||
Tests can be run using | ||
```sh | ||
npm test | ||
``` |
@@ -1,7 +0,16 @@ | ||
import thriftClient from '../src'; | ||
const CalculatorService = require('./support/thrift/CalculatorService'); | ||
const thriftClient = require('../src'); | ||
describe('pooledThriftClient', () => { | ||
beforeEach(() => { | ||
this.client = thriftClient(); | ||
this.poolOptions = { min: 0, max: 1 }; | ||
this.thriftOptions = { host: '127.0.0.1', port: 9090 }; | ||
}); | ||
describe('constructor', () => { | ||
it('creates a client implementing all Service methods', () => { | ||
const client = thriftClient(CalculatorService, this.poolOptions, this.thriftOptions); | ||
expect(client.add).toBeDefined(); | ||
}); | ||
}); | ||
}); |
@@ -7,4 +7,3 @@ { | ||
"helpers": [ | ||
"supprt/helpers/**/*.js", | ||
"../node_modules/babel-core/register.js" | ||
"supprt/helpers/**/*.js" | ||
], | ||
@@ -11,0 +10,0 @@ "stopSpecOnExpectationFailure": false, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34658
2
3
15
532
60
1
- Removedbabel-runtime@^6.26.0
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.11.1(transitive)