Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aisrael opened this issue Sep 28, 2022 · 1 comment

Comments

@aisrael
Copy link

aisrael commented Sep 28, 2022

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.

@janlelis
Copy link
Owner

janlelis commented Sep 29, 2022

Thanks for the positive feedback!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants