Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby like Fiber on Perl
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
t
.gitignore
.travis.yml
Build.PL
Changes
LICENSE
META.json
README.md
cpanfile
cpanfile.snapshot
minil.toml

README.md

Build Status

NAME

Fiber - Coroutine like Ruby Fiber

SYNOPSIS

use Fiber;

my $counter = Fiber->new(sub {
    my $n = 0;
    while (1) {
        Fiber->yield($n++);
    }
});

$counter->resume; # => 0
$counter->resume; # => 1
$counter->resume; # => 2

DESCRIPTION

Fiber is a coroutine implementaion like Ruby Fiber. This module is built upon Coro.

METHODS

  • new

    my $fiber = Fiber->new(sub { ... });
    

    Creates a new Fiber object that processes a given subrotuine reference.

  • yield

    my @ret = Fiber->yield(@vals);
    

    Control back to the context that resume the fiber, and passing @valus to it.

  • resume

    my @ret = $fiber->resume(@vals);
    

    Resumes the fiber from the point at which the last Fiber->yield was called, or starts running it if it is the first call to resume.

AUTHOR

Yohei Fushii hakobe@gmail.com

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Something went wrong with that request. Please try again.