Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2544

Re: How to know whether current Fiber is the root Fiber?

From 7stud -- <bbxx789_05ss@yahoo.com>
Newsgroups comp.lang.ruby
Subject Re: How to know whether current Fiber is the root Fiber?
Date 2011-04-08 13:37 -0500
Organization Service de news de lacave.net
Message-ID <924f39251213390fb702027274090882@ruby-forum.com> (permalink)
References <BANLkTinQAU_BbiTucU5DKxNXiFXyTcE9TQ@mail.gmail.com>

Show all headers | View raw


How about catching the exception?

begin
  Fiber.yield
rescue FiberError
  puts "In root fiber..."
  puts "... so I am going to do something different here."
end

puts 'executing rest of program'

--output:--
In root fiber...
.. so I am going to do something different here.
executing rest of program


Or, maybe do something like this:

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to know whether current Fiber is the root Fiber? Iñaki Baz Castillo <ibc@aliax.net> - 2011-04-08 07:30 -0500
  Re: How to know whether current Fiber is the root Fiber? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-08 13:37 -0500
    Re: How to know whether current Fiber is the root Fiber? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-08 13:56 -0500
      Re: How to know whether current Fiber is the root Fiber? Iñaki Baz Castillo <ibc@aliax.net> - 2011-04-11 02:30 -0500
        Re: How to know whether current Fiber is the root Fiber? Robert Klemme <shortcutter@googlemail.com> - 2011-04-11 02:52 -0500

csiph-web