@betit/orion
Pluggable microservice framework
Last updated 2 years ago by blekawski-mavrix .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @betit/orion 
SYNC missed versions from official npm registry.

Orion

Build Status Coverage Status NPM Version

Orion is a pluggable framework for microservices.

Following "batteries included but removable" design philosophy. Providing sane default implementations, but everything is swappable. Comes with built in support for various transports and codecs.

Features

  • Async communication: event driven architecture (pub/sub)
  • Sync communication: request-response transport layer
  • RPC: clean and simple interface to build services

Components

  • Transport: provides an interface for sync request/response communication
  • Codec: used for encoding and decoding messages before transporting across the wire
  • Service: provides an interface to name your service and register request handlers
  • Client: provides an interface to make requests to services

Built-in components

  • Transports: NATS (default)
  • Codecs: JSON (default), MessagePack

Example

Service:

const orion = require('@betit/orion');

const service = new orion.Service('calc');

service.handle('add', (req, reply) => {
  reply(null, parseInt(req.params.a) + parseInt(req.params.b));
});

service.listen(() => {
  console.log(`Service started: ${service}`);
});

Client:

const orion = require('@betit/orion');

const client = new orion.Client({ service: 'calc' });

client.call('add', { a: 3, b: 2 }, (err, res) => {
  console.log(err, res);
  client.close();
});

Check out the examples folder for more examples.

Development

$ docker run -p 4222:4222 -p 8222:8222 -d nats
$ npm install
$ npm test

License

MIT

Current Tags

  • 0.1.34                                ...           latest (2 years ago)

40 Versions

  • 0.1.34                                ...           2 years ago
  • 0.1.33                                ...           2 years ago
  • 0.1.32                                ...           3 years ago
  • 1.0.0-beta.6                                ...           3 years ago
  • 1.0.0-beta.5                                ...           3 years ago
  • 1.0.0-beta.4                                ...           3 years ago
  • 1.0.0-beta.3                                ...           3 years ago
  • 1.0.0-beta.2                                ...           3 years ago
  • 1.0.0-beta.1                                ...           3 years ago
  • 0.1.31                                ...           3 years ago
  • 0.1.30                                ...           3 years ago
  • 0.1.29                                ...           3 years ago
  • 0.1.28                                ...           3 years ago
  • 0.1.27                                ...           3 years ago
  • 0.1.26                                ...           3 years ago
  • 0.1.25                                ...           3 years ago
  • 0.1.24                                ...           3 years ago
  • 0.1.23                                ...           4 years ago
  • 0.1.22                                ...           4 years ago
  • 0.1.21                                ...           4 years ago
  • 0.1.20                                ...           4 years ago
  • 0.1.19                                ...           4 years ago
  • 0.1.18                                ...           4 years ago
  • 0.1.17                                ...           4 years ago
  • 0.1.16                                ...           4 years ago
  • 0.1.15                                ...           4 years ago
  • 0.1.14                                ...           4 years ago
  • 0.1.13                                ...           4 years ago
  • 0.1.12                                ...           4 years ago
  • 0.1.11                                ...           4 years ago
  • 0.1.10                                ...           4 years ago
  • 0.1.9                                ...           4 years ago
  • 0.1.8                                ...           4 years ago
  • 0.1.7                                ...           4 years ago
  • 0.1.6                                ...           4 years ago
  • 0.1.5                                ...           4 years ago
  • 0.1.4                                ...           4 years ago
  • 0.1.3                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 40
Last Week 40
Last Month 82
Dependencies (3)
Dev Dependencies (19)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |