Code Monkey home page Code Monkey logo

eventmachine's Introduction

About EventMachine

What is EventMachine

EventMachine is an event-driven I/O and lightweight concurrency library for Ruby. It provides event-driven I/O using the Reactor pattern, much like JBoss Netty, Apache MINA, Python's Twisted, Node.js, libevent and libev.

EventMachine is designed to simultaneously meet two key needs:

  • Extremely high scalability, performance and stability for the most demanding production environments.
  • An API that eliminates the complexities of high-performance threaded network programming, allowing engineers to concentrate on their application logic.

This unique combination makes EventMachine a premier choice for designers of critical networked applications, including Web servers and proxies, email and IM production systems, authentication/authorization processors, and many more.

EventMachine has been around since the early 2000s and is a mature and battle tested library.

What EventMachine is good for?

What platforms are supported by EventMachine?

EventMachine supports Ruby 1.8.7, 1.9.2, REE, JRuby and works well on Windows as well as many operating systems from the Unix family (Linux, Mac OS X, BSD flavors).

Install the gem

Install it with RubyGems

gem install eventmachine

or add this to your Gemfile if you use Bundler:

gem "eventmachine"

Getting started

For an introduction to EventMachine, check out:

Server example: Echo server

Here's a fully-functional echo server written with EventMachine:

 require 'eventmachine'

 module EchoServer
   def post_init
     puts "-- someone connected to the echo server!"
   end

   def receive_data data
     send_data ">>>you sent: #{data}"
     close_connection if data =~ /quit/i
   end

   def unbind
     puts "-- someone disconnected from the echo server!"
  end
end

# Note that this will block current thread.
EventMachine.run {
  EventMachine.start_server "127.0.0.1", 8081, EchoServer
}

EventMachine documentation

Currently we only have reference documentation and a wiki.

Community and where to get help

  • Join the mailing list (Google Group)
  • Join IRC channel #eventmachine on irc.freenode.net

License and copyright

EventMachine is copyrighted free software made available under the terms of either the GPL or Ruby's License.

Copyright: (C) 2006-07 by Francis Cianfrocca. All Rights Reserved.

Alternatives

If you are unhappy with EventMachine and want to use Ruby, check out Cool.io. One caveat: by May 2011, it did not support JRuby and Windows.

eventmachine's People

Contributors

ae9rb avatar arthurschreiber avatar bernd avatar bklang avatar bpot avatar davidsmalley avatar dj2 avatar dre3k avatar flameeyes avatar garbagecat avatar ghazel avatar gnufied avatar igrigorik avatar iragsdale avatar jakedouglas avatar jasonmay avatar jbrown avatar libc avatar luislavena avatar michaelklishin avatar mrkn avatar neilconway avatar nolman avatar paddor avatar phiggins avatar raggi avatar smparkes avatar tmm1 avatar wishdev avatar wyhaines avatar

Stargazers

 avatar

Watchers

 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.