janlelis/whirly

Suggestion: Make Whirly.start { # block } return the result of the block

Opened this issue · 1 comments

Hi! Big fan of whirly, use it in almost all my scripts with long-running processes.

I frequently find myself going something like:

def foo
  Whirly.start
  result = do_foo
  Whirly
  result
end

Only because when Whirly.start is called with a block, it returns true.

I think that with a few code changes in whirly.rb#L168, we can make it return the result of the given block, allowing for:

def foo
  Whirly.start do
    do_foo
  end
end

I'd be happy to submit a PR if this suggestion is accepted.

Thanks for the positive feedback!

Good idea, I'd be happy to merge such a PR!