# Fiber exists before require 'fiber'

**URL:** <https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428>\
**Category:** Ruby\
**Created:** [June 13, 2008, 9:16pm UTC](https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428 "2008-06-13T21:16:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [June 13, 2008, 9:16pm UTC](https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428/1 "2008-06-13T21:16:51Z")

</div>

So, in 1.9 it appears that the Fiber class exists before you’ve required  
fiber. Thoughts?

irb(main):001:0\> Fiber  
=\> Fiber  
irb(main):002:0\> Fiber.current  
NoMethodError: undefined method `current' for Fiber:Class from (irb):2 from /Users/rogerpack/19/bin/irb:12:in`’  
irb(main):003:0\> require ‘fiber’  
=\> true  
irb(main):004:0\> Fiber.current  
=\> #Fiber:0x11bb10

And, oddly, only fiber.bundle exists, not fiber.rb

is this more like ‘supplemental fiber methods’ or something?  
Anyway it works, I’m just curious.  
Thanks!  
-R

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [June 13, 2008, 9:22pm UTC](https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428/2 "2008-06-13T21:22:13Z")

</div>

On Jun 13, 2008, at 2:16 PM, Roger P. wrote:

> is this more like ‘supplemental fiber methods’ or something?  
> Anyway it works, I’m just curious.

Without the require, you get asymmetric fibers: they’re useful as  
generators. With the require, you get symmetric ones, which are closer  
to coroutines.

Dave

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [June 13, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428/3 "2008-06-13T22:08:03Z")

</div>

On Fri, Jun 13, 2008 at 3:21 PM, Dave T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Without the require, you get asymmetric fibers: they’re useful as  
> generators. With the require, you get symmetric ones, which are closer to  
> coroutines.

Nope, that’s not confusing at all! 😉

–  
Avdi

Home: [http://avdi.org](http://avdi.org)  
Developer Blog: [Avdi Grimm, Code Cleric](http://avdi.org/devblog/)  
Twitter: [http://twitter.com/avdi](http://twitter.com/avdi)  
Journal: [http://avdi.livejournal.com](http://avdi.livejournal.com)

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [June 13, 2008, 10:33pm UTC](https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428/4 "2008-06-13T22:33:54Z")

</div>

Roger P. wrote:

> is this more like ‘supplemental fiber methods’ or something?

> **[Ruby 1.9 adds Fibers for lightweight concurrency](https://www.infoq.com/news/2007/08/ruby-1-9-fibers/)**
>
> Fibers were recently in the Ruby 1.9 branch. The Coroutine-like concept has many uses, such as implementing lightweight concurrency and others. We look at the concept and influences of Fibers in Ruby 1.9, as well as code samples.

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [June 16, 2008, 10:00pm UTC](https://www.ruby-forum.com/t/fiber-exists-before-require-fiber/140428/5 "2008-06-16T22:00:54Z")

</div>

Dave T. wrote:

> On Jun 13, 2008, at 2:16 PM, Roger P. wrote:
> 
> > is this more like ‘supplemental fiber methods’ or something?  
> > Anyway it works, I’m just curious.
> 
> Without the require, you get asymmetric fibers: they’re useful as  
> generators. With the require, you get symmetric ones, which are closer  
> to coroutines.
> 
> Dave

Thanks that answered it.  
-R
