We are glad to announce shiny new release of BackgrounDRb, which will
soon become 1.0.
A quick summary of changes:
BackgrounDRb is no londer DRb, its based on event driven network
programming library packet ( http://www.packet.googlecode.com ) .
Since we moved to packet, many nasty thread issues, result hash
corruption issues are totally gone. Lots of work has went in
making scheduler rock solid stable.
Each worker, still runs in its own process, but each worker has a
event loop of its own and all the events are triggered by the internal
reactor loop. In a nutshell, you are not encouraged to use threads
in your workers now. All the workers are already concurrent, but you
are encouraged to use co-operative multitasking, rather than
pre-emptive. A simple example is,
For implement something like progress bar in old version of bdrb, you
would:
start your processing a thread (so as your worker can receive
further request from rails ) and have a instance
variable ( protected by mutex ) which is updated on progress and
can be send to rails.
With new backgroundrb, progrss bar would be:
process your damn request and just use register_status() to
register status of your worker. Just because
you are doing some processing won’t mean that your worker will
block. It can still receive requests from rails.
Now, you can schedule mulitple methods with their own triggers.
Inside each worker, you can start tcp server or connect to a
external server. Two important methods available in all workers are:
Connected client or outgoing connection would be integrated with
Event Loop and you can process requests from these guys
asynchronously. This mouse trap can allow you to build truly
distributed workers across your network.
Hemant, this looks great. Could one use BackgroundRb to have workers
interact programatically with a remote telnet service? Or would I
simply start a worker that does this interaction via a
shell/spawn/telnet/expect…
On Tue, 2007-12-11 at 23:08 +1100, George Bray wrote:
Hemant, this looks great. Could one use BackgroundRb to have workers
interact programatically with a remote telnet service? Or would I
simply start a worker that does this interaction via a
shell/spawn/telnet/expect…
Sure as hell… with any tcp service actually in a evented manner.
However, that area is not polished ( no one ever asked. )
Has this been tested on Windows? If so, are there known issues?
Previous versions did not work on Windows, although the original
version did.
No, it won’t work on Windows. Even when I removed “slave”, still we need
unix domain sockets for internal communication, which is not available
on windows.
–
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.
Looking forward to a chance to use this library. Thanks for the work!
On 10-Dec-07, at 6:47 PM, hemant wrote:
BackgrounDRb is no londer DRb, its based on event driven network
programming library packet ( http://www.packet.googlecode.com ) .
How does this affect the licensing of BackgrounDRb (not to mention the
name of the project :-)? The packet library is GPLv2 (the url doesn’t
have the leading www by the way), while BackgrounDRb is dual licensed
with the Ruby License or an MIT license.
How does this affect the licensing of BackgrounDRb (not to mention the
name of the project :-)? The packet library is GPLv2 (the url doesn’t
have the leading www by the way), while BackgrounDRb is dual licensed
with the Ruby License or an MIT license.
Damn I realized it after posting the message. But then thought “packet”
may be irrelevant anyways ( to rails guys i mean )
Regarding license issues, since packet is dual licensed under GPL2 and
Ruby, you can take shit from packet and embed in your app and forget
that its under GPL2, since Ruby license allows you do that. There is a
clause from Ruby license that says:
“place your modifications in the Public Domain or otherwise
make them Freely Available, such as by posting said
modifications to Usenet or an equivalent medium, or by allowing
the author to include your modifications in the software.”
So, I guess its ok to have that.
–
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.
Since we moved to packet, many nasty thread issues, result hash
corruption issues are totally gone. Lots of work has went in
making scheduler rock solid stable.
Well, i think one of the strengths of packet is, it lets you write
tightly integrated workers with master process. So, this way, you can
offload blocking tasks to these workers, which will run parallely and
keep processing further requests in master.
And its pure ruby.
Sounds cool. I think EM also does pure ruby these days–seems like a
trend
Now if I can just figure out which is the latest version of
acts_as_ferret that runs on win32…
Thanks for any help.
-Roger
Well, i think one of the strengths of packet is, it lets you write
tightly integrated workers with master process. So, this way, you can
offload blocking tasks to these workers, which will run parallely and
keep processing further requests in master.
And its pure ruby.
–
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.