Git Product home page Git Product logo

celluloid-io's Introduction

Celluloid::IO

Gem Version MIT licensed Build Status Maintained: no

You don't have to choose between threaded and evented IO! Celluloid::IO provides an event-driven IO system for building fast, scalable network applications that integrates directly with the Celluloid actor library, making it easy to combine both threaded and evented concepts. Celluloid::IO is ideal for servers which handle large numbers of mostly-idle connections, such as Websocket servers or chat/messaging systems.

Celluloid::IO provides a different class of actor: one that's slightly slower and heavier than standard Celluloid actors, but one which contains a high-performance reactor just like EventMachine or Cool.io. This means Celluloid::IO actors have the power of both Celluloid actors and evented I/O loops. Unlike certain other evented I/O systems which limit you to a single event loop per process, Celluloid::IO lets you make as many actors as you want, system resources permitting.

Rather than callbacks, Celluloid::IO exposes a synchronous API built on duck types of Ruby's own IO classes, such as TCPServer and TCPSocket. These classes work identically to their core Ruby counterparts, but in the scope of Celluloid::IO actors provide "evented" performance. Since they're drop-in replacements for the standard classes, there's no need to rewrite every library just to take advantage of Celluloid::IO's event loop and you can freely switch between evented and blocking IO even over the lifetime of a single connection.

Celluloid::IO uses the nio4r gem to monitor IO objects, which provides cross-platform and cross-Ruby implementation access to high-performance system calls such as epoll and kqueue.

Like Celluloid::IO? Join the Celluloid Google Group

Documentation

Please see the Celluloid::IO Wiki for more detailed documentation and usage notes.

YARD documentation is also available

Installation

Add this line to your application's Gemfile:

gem 'celluloid-io'

And then execute:

$ bundle

Or install it yourself as:

$ gem install celluloid-io

Inside of your Ruby program, require Celluloid::IO with:

require 'celluloid/io'

Supported Platforms

Celluloid::IO works on all Ruby (MRI) versions between 1.9.3 & 2.3.1, JRuby's 1.6.*, 1.7.* and 9.* series, and Rubinius' 2.* and 3.* series.

JRuby or Rubinius are the preferred platforms as they support true thread-level parallelism when executing Ruby code, whereas MRI/YARV is constrained by a global interpreter lock (GIL) and can only execute one thread at a time.

Celluloid::IO requires Ruby 1.9 mode on all interpreters, at minimum.

Contributing to Celluloid::IO

  • Fork this repository on github
  • Make your changes and send me a pull request
  • If I like them I'll merge them
  • If I've accepted a patch, feel free to ask for a commit bit!

License

Copyright (c) 2011-2016 Tony Arcieri. Distributed under the MIT License. See LICENSE.txt for further details.

Contains code originally from the RubySpec project also under the MIT License. Copyright (c) 2008 Engine Yard, Inc. All rights reserved.

Contains code originally from the 'OpenSSL for Ruby 2' project released under the Ruby license. Copyright (C) 2001 GOTOU YUUZOU. All rights reserved.

celluloid-io's People

Contributors

tarcieri avatar digitalextremist avatar halorgium avatar ioquatix avatar benlangfeld avatar tricknotes avatar derekparker avatar asmod4n avatar paddor avatar chewie avatar kyledrake avatar kostya avatar justinmcp avatar tonkpils avatar rimenes avatar rjattrill avatar cesare avatar laserlemon avatar tbuehlmann avatar wteuber avatar benlovell avatar nning avatar stopiccot avatar jwkoelewijn avatar fbernier avatar e1senh0rn avatar dicom avatar bkerley avatar nono avatar codekitchen 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.