GithubHelp home page GithubHelp logo

mite's Introduction

Mite

Mite is an Arthropod based Rack server. Let me try to explain:

  • Arthropod is a small library that makes it easy to call remote Ruby code using Amazon SQS.
  • Mite uses Arthropod to listen to SQS messages on a given and expects to get an Rack env.
  • It will call your app with this env and respond to the Arthropod call with the usual status, headers and body.

It can probably be used to do pretty edgy stuff like building a remote Rack middleware, but I only use it in conjuction with Amazon Lambda to serve pages and API calls from Rails apps that happens to live behind a NAT and with a dynamic IP address allocation, because I do have tons of little pet projects that sometimes requires lots of CPU/lots of RAM/CUDA. Also, in those case I don't care much about latency (it's not horrible though, fast enough for pet projects).

Installation

gem install mite

Usage

Just run it with the required arguments.

$ mite -h

Usage: mite [options]
    -q, --queue [string]             SQS queue name
    -i, --access-key-id [string]     AWS access key ID, default to the AWS_ACCESS_KEY_ID environment variable
    -k, --secret-access-key [string] AWS secret access key, default to the AWS_SECRET_ACCESS_KEY environment variable
    -r, --region [string]            AWS region, default to the AWS_REGION environment variable
    -c, --config [string]            The path to your config.ru file

Rails

It should works well with Rails, just call it with mite -c ./config.ru in your Rails root directory.

Lambda

I usually use Amazon Lambda to push messages to SQS form an API Gateway resource. Take a look at mite-lambda-proxy to see how you can setup something like that on your own.

mite's People

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.