Sha256: 6e17fd517e039b675847ea250a526ad62cb0d608e70827f8e1991b1d6b1b36d8

Contents?: true

Size: 885 Bytes

Versions: 1

Compression:

Stored size: 885 Bytes

Contents

# PbActor

Process based Actor.

## Installation

Add this line to your application's Gemfile:

    gem 'pb_actor'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install pb_actor

## Usage

```ruby
require 'pb_actor'

class Test
  include PbActor
  def fib(n)
    if n < 2
      1
    else
      fib(n - 1) + fib(n - 2)
    end
  end

  def p_fib(n)
    puts fib(n)
  end
end

f = Test.new
#=> <PbActor::Proxy:0x00000002106448 @origin=#<Test:0x00000002106470>, @pid=23487, @rd=#<IO:fd 7>, @wr=#<IO:fd 10>>

f.alive?
#=> true

f.fib(30)
#=> 1346269

f.async.p_fib(30)
#=> nil
# 1346269

f.terminate
f.alive?
#=> false
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pb_actor-0.0.1 README.md