Code Monkey home page Code Monkey logo

buslane's Introduction

Buslane

Coverage Status

Intro

Buslane is a cross-service and transparent object.method proxy, using an rpc-lite json/http1 transport.

The need for this lib came about when we decided to move to docker at 5app. I wanted a simple way to remove our direct code dependencies between services without having to add extra endpoints manually.

With buslane and its RPC like object proxying, you can call methods on remote objects as if they were in the same context. So there is no need to create specific service endpoints either. Just write the configuration and buslane will expose the objects to each other.

This is all still very experimental, so use with caution, I sure am.

Config & Usage

Install the buslane package using:

npm install --save @5app/buslane

Now, you will need to create a Buslane instance which you can use to make service1 and service2 communicate:

const Buslane = require('@5app/buslane');

const thisServiceName = 'service1';
const config = {
	name: thisServiceName,
	shared_api_key: 'my shared secret key',
	map: [
		{name: 'service2', port: 11211, ingresses: ['boat']},
		{name: thisServiceName, port: 11311, ingresses: []},
	],
};

const buslane = new Buslane(config);
const rpcResult = await buslane.service2.boat.sail('ocean');

Test

build and run with docker:

docker build -t buslane . && docker run buslane

Comparison with Buslane 2

Buslane 3 uses HTTP1 while Buslane 2 uses HTTP2. The decision on dropping HTTP2 in favour of HTTP1 was made in order to resolve 2 issues:

  • Recover connections after the service recovers: this can also be achieved by re-attempting connections and handling extra HTTP2 headers like GOAWAY (in addition to the current ERR_HTTP2_INVALID_SESSION).
  • Load balancing requests between multiple instances of the same service: HTTP2 creates a session which binds 2 services (instances) together using a TCP connection. As a session-less protocol, HTTP1 does not have this issue, but on the other hand, there will be a handshake every time a request is made (with extra overhead compared to HTTP2).

buslane's People

Contributors

5app-machine avatar greenkeeper[bot] avatar ikhemissi avatar mrswitch avatar renovate-bot avatar renovate[bot] avatar seektheerror avatar semantic-release-bot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

seektheerror

buslane's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm eslint-plugin-node Available

Warning

Renovate failed to look up the following dependencies: Failed to look up orb package fiveapp/release.

Files affected: .circleci/config.yml


Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • node 5.1.0
  • release 0.0.3
npm
package.json
  • @5app/logger ^2.3.0
  • @5app/semantic-release-config ^1.0.3
  • @semantic-release/changelog ^6.0.1
  • @semantic-release/git ^10.0.1
  • chai ^4.3.6
  • chai-as-promised ^7.1.1
  • coveralls ^3.1.1
  • eslint ^8.23.0
  • eslint-config-5app ^0.19.0
  • eslint-plugin-node ^11.1.0
  • mocha ^10.0.0
  • nyc ^15.1.0
  • pre-commit ^1.2.2
  • semantic-release ^21.0.0
  • node >=12.0.0
nvm
.nvmrc
  • node 18

  • Check this box to trigger a request for Renovate to run again on this repository

Unable to send a nullish value

The response body of the request, when falsy, is converted to an object. This is rather a hindrance when one intentionally wants to return a falsy value. This has led to work arounds like the following https://github.com/5app/dashboard/pull/7340/files#diff-4fdfe0a443e487eb208a9f1268377584R57

An in-range update of coveralls is breaking the build ๐Ÿšจ

The devDependency coveralls was updated from 3.0.6 to 3.0.7.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โœ… ci/circleci: checkout_code: Your tests passed on CircleCI! (Details).
  • โŒ ci/circleci: test: Your tests failed on CircleCI (Details).

Commits

The new version differs by 1 commits.

  • 2ed185c added support for GitLab Merge Request IID

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.