ruby 异步事件驱动的Ruby Web应用框架 Cramp

Cramp是一种新的,处 理并发事件的Web应用程序框架,由37signals和Rails核心小组的Pratik Naik提供。它建立在Ruby的EventMachine库之上,主要用于处理一些大量的开放连接 (如Comet系统或streaming APIs),整个过程都使用event-driven I/O。

Cramp使用Rails 3.0的ActiveSupport 和 ActiveModel库, 它会显示两层用于开发:controllers 和 models。

示例代码:

require 'rubygems'
require 'cramp/controller'

class WelcomeAction < Cramp::Controller::Action
  on_start :send_hello_world

  def send_hello_world
    render "Hello World"
    finish
  end
end

Rack::Handler::Thin.run WelcomeAction, :Port => 3000

安装方法:

gem install arel --pre
gem install activemodel --pre

And then,

gem install cramp

转自:http://www.oschina.net/p/cramp/
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值