Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 17 lines (11 sloc) 0.336 kb
115ec23 @davidbalbert `link` on a dead fiber schedules it immediately
authored
1 #!/usr/bin/env ruby
2 # If we link a method to a dead fiber, it should be called immediately
3
4 $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5 require 'eventless'
6
7 def say_goodbye(fiber)
8 puts "goodbye!"
9 end
10
11 f = Eventless.spawn { puts "in the fiber" }
12 f.join
13
14 f.link(self, :say_goodbye)
15 sleep 0 # yield back to the event loop
16
Something went wrong with that request. Please try again.