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

feathers-opossum

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-opossum

A service plugin for opossum

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

feathers-opossum

Build Status Coverage Status dependencies Status Known Vulnerabilities

feathers-opossum is a circuit breaker for Feathers adapters. It implements the opossum module.

npm install feathers-opossum --save

API

service(options)

const service = require('service');
const opossumService = require('feathers-opossum');

const options = {
  opossum: {
    timeout: 200, // If our function takes longer than 3 seconds, trigger a failure
    errorThresholdPercentage: 50, // When 50% of requests fail, trip the circuit
    resetTimeout: 30000 // After 30 seconds, try again.
  },
  fallback: () => {
    errro: 'Sorry, out of service right now';
  },
  onFallback: result => reportFallbackEvent(result),
  // this means only find and get method relay on circur breaking
  methods: ['find', 'get'], // feel free to use updat, patch amd remove
};

const circuitedService = opossumService(service, {id:'_id', paginate: {max:10 }, options);

app.use('/may-fail', circuitedService);

Changelog

0.1.0

  • publish

...

License

Copyright (c) 2020

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 12 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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