0.1.6 • Published 7 years ago

xen-service v0.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Xen Service

Simple and flexible microservice library. Features:

  • declarative constructor syntax
  • action/dispatch-based internal RPC (inspired by Flux)
  • functional to the core
  • build services with RxJS 5, Promises, or blocking code
  • TODO wrap dispatch in middleware, or override it completely
  • TODO external RPC helper for Docker Swarm mode service discovery
  • TODO trace dispatches across multiple nested procedure calls

WIP Creating a Service

XenServer.createService accepts a service config object and returns an Observable.

const XenService = require('xen-service');

// Configure your new service
XenService.createService({
  name: 'MyService',
  procedures: {
    test: () => 'Prepare for unforeseen consequences'
  }
})
// Create the service by subscribing to it
.subscribe(service => {
  // Once the service is ready, invoke the "test" procedure by
  // dispatching an action of the same type
  service.dispatch({
    type: 'test'
  })
  .subscribe(response => {
    console.log(service); // 'Prepare for unforeseen consequences'
  });
})
0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago