Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brigade/pooled-thrift-client

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brigade/pooled-thrift-client - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

.nvmrc

11

CHANGELOG.md

@@ -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

13

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc