最新文章列表

Fiber和Ruby 实现管道式过滤器

  # Fiber和Ruby的功能展示的淋漓尽致。大致解说下,PipelineElement作为任何一个过滤器的父类,其中封装了一个fiber,# 这个fiber默认执行process,在process方 ...
michael_roshen 评论(0) 有91人浏览 2015-05-14 14:23

(翻译)Untangling Evented Code with Ruby Fibers

    Untangling Evented Code with Ruby FibersBy Ilya Grigorik on March 22, 2010Event-driven programming requires a mind-shift in how you architect the program, and oftentimes directly affects the c ...
michael_roshen 评论(0) 有168人浏览 2015-05-06 18:23

eventmachine 实例

require 'eventmachine'require 'em-http'require 'fiber'EventMachine.run do  page = EventMachine::HttpRequest.new('http://michael-roshen.iteye.com/').get  page.errback{p "baidu is down! terminate?&q ...
michael_roshen 评论(0) 有244人浏览 2015-05-06 17:06

Fiber-参数传递

    Fiber-参数传递 当一个fiber创建后不会立即执行,除非调用Fiber#resume方法,Fiber.yield放弃控制权给调用者,这里的调用者是Fiber#resume的调用者,就是主程序 fiber = Fiber.new do  Fiber.yield 1  2endputs fiber.resumeputs fiber.resumeputs fiber.resum ...
michael_roshen 评论(0) 有325人浏览 2015-05-06 15:59

一小段代码理解Fiber

server = Fiber.new do |request| puts 'Server Started' while(request != 'exit') puts "Received request: #{request}" request = Fiber.yield Random.rand end end response = ...
yuan 评论(0) 有1449人浏览 2012-03-24 17:55

最近博客热门TAG

Java(141744) C(73651) C++(68608) SQL(64571) C#(59609) XML(59133) HTML(59043) JavaScript(54919) .net(54785) Web(54514) 工作(54118) Linux(50905) Oracle(49875) 应用服务器(43289) Spring(40812) 编程(39454) Windows(39381) JSP(37542) MySQL(37267) 数据结构(36424)

博客人气排行榜

    博客电子书下载排行

      >>浏览更多下载

      相关资讯

      相关讨论

      Global site tag (gtag.js) - Google Analytics