Hail John,
On Sep 15, 2009, at 9:33 PM, John Mettraux wrote:
> the split method is not related to the creation of the "work"
> directory. FsStorageEngine is independent from any WfidGenerator when
> creating its hierarchy under "work" (mkdir -p).
>
> Creating directories is not a responsibility of the engine, it's up to
> the services and they tend to not trust each others for such matters.
What I'm trying to say is that in current ruote2.0 there are services
that rely on "work" existing but don't create the directory if it
doesn't exist, thus throwing an exception. Manual effort is required
on my part for Ruote to function without the wfidgenerator (mkdir from
shell, or FileUtils.mkdir from in my code).
If I understand you correctly, you're saying that the services
shouldn't trust each other for things like pre-existing directories,
but I'm trying to point out that they currently do, and was
additionally suggesting a DRY solution (FsStorageEngine init mkdir's
workdir) over the non-DRY check-for-workdir-in-every-single-
build_service-statement. I understand that it's outside the engine's
job, but AFAICT that's the quickest DRY way to fix this.
Observe my ruote server with overridden wfidgenerator and no work
directory:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/fileutils.rb:1032:in `initialize': No such file or directory -
work/tracker.ruote (Errno::ENOENT)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/fileutils.rb:1032:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/fileutils.rb:1032:in `touch'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/fileutils.rb:1026:in `each'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/fileutils.rb:1026:in `touch'
from .../vendor/ruote.git/lib/ruote/util/bucket.rb:34:in `initialize'
from .../vendor/ruote.git/lib/ruote/evt/fs_tracker.rb:44:in `new'
from .../vendor/ruote.git/lib/ruote/evt/fs_tracker.rb:44:in `context='
from .../vendor/ruote.git/lib/ruote/engine/engine.rb:243:in
`add_service'
from .../vendor/ruote.git/lib/ruote/engine/fs_engine.rb:49:in
`build_tracker'
from .../vendor/ruote.git/lib/ruote/engine/engine.rb:101:in
`initialize'
> You can change the engine_id via the option :engine_id at engine
> initialization.
Sweet, thanks.
>> try to run that piece of Ruby code :
>>
>> ---8<---
>> Thread.new do
>> return :nada
>> end.join
>> --->8---
>>
>> Since block participant, by default, lets the engine wraps its
>> consume
>> action in a Thread, that triggers your error.
FYI, a helpful person on #ruby gave me the solution:
Thread.exit
It ain't as pretty as return, but it works and it's a 1:1 replacement
for my previous usage of return.
cheers,
--jordan
--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---