Skip to content

railsware/em-rest-client

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

!!! LEGACY PROJECT !!!

Is not supported anymore because we renamed and migrated it to new project.

Please use rest-client-adapters instead.

EM-REST-Client

This gem allows to use different HTTP implementation in RestClient with next adapters:

  • :net_http - Net::HTTP (default, blocking I/O)
  • :em_http - EventMachine::HttpRequest (non-blocking I/0)

Installation

Add this line to your application's Gemfile:

gem 'em-rest-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install em-rest-client

Usage

You may specify adapter for each request:

RestClient.get('https://www.google.com')
RestClient.get('https://www.google.com', adapter: :em_http)

Or you may specify adapter globaly:

RestClient.adapter = :em_http
RestClient.get('https://www.google.com')

Notes

When EventMachine is already running we assume that you are responsible for Fiber allocation. You can add Rack::FiberPool to your application middleware and it automatically provides a Fiber for each incoming HTTP request. It creates pool of Fibers and re-use fiber for each incoming HTTP request. Also you can control the connection pool size.

Authors

References

About

EventMachine::HttpRequest adapter for HTTP REST client

Resources

License

Stars

Watchers

Forks

Packages

No packages published