GithubHelp home page GithubHelp logo

ernicorn's Introduction

Ernicorn

A BERT-RPC server based on Ernie's Ruby interface but that uses Unicorn for worker process management.

Ernicorn supports BERT-RPC call and cast requests. See the full BERT-RPC specification at bert-rpc.org for more information.

Like Ernie before it, Ernicorn was developed at GitHub and is currently in production use serving millions of RPC requests every day.

Installation

$ gem install ernicorn

Starting The Server

Use the ernicorn command to start a new RPC server:

$ ernicorn --help
Usage: ernicorn [options] [config file]
Start a Ruby BERT-RPC Server with the given options and config file.

Options
  -h, --host=<host>          Server address to listen on; default: 0.0.0.0
  -p, --port=<portno>        Server port to listen on; default: 8149
  -l, --listen=<host>:<port> Listen addresses. Can be specified multiple times
      --log-level=0-4        Set the log level
  -d, --detached             Run as a daemon
  -P, --pidfile=<file>       Location to write pid file

The ernicorn server attempts to load the config file given or config/ernicorn.rb when no config file is specified. See the example config file examples/config.rb to get started. All Unicorn config options are supported.

The config file should require any libraries needed for the server and register server modules with Ernicorn.expose(:modulename, TheModule). See the examples/handler.rb file for a simple example handler.

Control Commands

The ernicorn-ctrl command can be used to send various control and informational commands to the running server process:

$ ernicorn-ctrl --help
Usage: ernicorn-ctrl [-p <port>] <command>
Issue a control command to an ernicorn server. The port option is used to
specify a non-default control port.

Commands:
  reload-handlers         Gracefully reload all handler processes.
  stats                   Dump handler stats for the server.
  halt                    Shut down.

Ernicorn servers also support most Unicorn signals for managing worker processes and whatnot. See the SIGNALS file for more info.

Development

The script/bootstrap command is provided to setup a local gem environment for development.

$ script/bootstrap

It installs all gems under vendor/gems and creates binstubs under a bin directory. This is the best way to get setup for running tests and experimenting in a sandbox.

ernicorn's People

Contributors

rtomayko avatar tmm1 avatar

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.