Cramp是一种新的,处理并发事件的Web应用程序框架,由37sigals和Rails核心小组的PratikNaik提供。它建立在Ruby的EvetMachie库之上,主要用于处理一些大量的开放连接(如Comet系统或streamigAPIs),整个过程都使用evet-driveI/O。
Cramp使用Rails3.0的ActiveSupport和ActiveModel库,它会显示两层用于开发:cotrollers和models。
示例代码:
require'rubygems'require'cramp/cotroller'classWelcomeActio<Cramp::Cotroller::Actioo_start:sed_hello_worlddefsed_hello_worldreder"HelloWorld"fiishededRack::Hadler::Thi.ruWelcomeActio,:Port=>3000安装方法:
gemistallarel--pregemistallactivemodel--preAdthe,
gemistallcramp
评论