ANN: Object#detach and background method dispatching

E

Evan Webb

Now available on raa.ruby-lang.org:

Object#dispatch - A very simple method that uses drb to allow any object
to be detached and run it it's own process, but can be used in exactly
the same way that original was used.

Example:
require 'detach'
s = "blah"
s2 = s.detach #s is now running in a seperate process
s2.size #4
s2.to_s #blah

Also features background method dispatching, which allows the caller of
a method of a detach method to perform such calls non-blocking, and only
when the returned object is actually used are operations blocked.

Example:
require 'detach'
u = Universe.new.detach
s = u.size # Whereas this would normally block now,
# and take a very long time, you can
# query it's running
s.ready? # false
sleep VERY_LONG_TIME
s.ready? # true
s.to_s # "about 10 billion light years in radius"


Evan Webb // (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top