New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serviced

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serviced

Microservice dependency readiness probe

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Serviced

Build Status Coverage Status Dependency Status npm version

Microservice dependency readiness probe

Small utility to probe for backing-service availability using http calls and promises. This will likely evolve to be more compatible but, for now, it uses features available in Node 6+. Feel free to send pull requests or open issues to make it compatible with earlier versions.

I use this to ensure I don't start certain processes (for example, our API server) before the backing services (db, message broker and kubernetes api) are up, running and reachable. Internally serviced uses backoff and request for http calls and retries.

Usage

npm i serviced
const Serviced = require('serviced');

const service1 = {
  name: 'db',
  url: 'http://db',
  json: true,
  maxDelay: 1000,
  numberOfBackoffs: 10,
  test(body) {
    return body.foo === true;
  },
};

const service2 = {
  name: 'kubernetes',
  url: 'http://localhost:8080',
  test(body) {
    return body.bar === true;
  },
};

const services = new Serviced(service1, service2);

services.then(() => {
  // Your services have responded and are ready.
});

Keywords

FAQs

Package last updated on 24 Jun 2016

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