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

Block syntax for scanning, finishing, pausing and resuming. #45

Open
geshwho opened this issue Jun 18, 2022 · 3 comments
Open

Block syntax for scanning, finishing, pausing and resuming. #45

geshwho opened this issue Jun 18, 2022 · 3 comments

Comments

@geshwho
Copy link
Contributor

geshwho commented Jun 18, 2022

What do you think about supporting a block style syntax for enabling/disabling N+1 detection.

For example:

Prosopite.scan do
  example.run
end

in addition to:

Prosopite.scan
example.run
Prosopite.finish

Similarly, pausing could be something like:

Prosopite.pause do
  code_with_n+1()
end

in addition to:

Prosopite.pause
  code_with_n+1()
Prosopite.resume
@oskarpearson
Copy link
Contributor

oskarpearson commented Jun 22, 2022

@geshwho I think this is now already done - let us know if you have any issues.

Block format for .scan was already implemented in the codebase - and #41 makes the result available to the caller and puts something in the docs for this. I'm hoping it'll be merged soon

I implemented pause a while back similarly in https://github.com/charkost/prosopite/pull/42/files and it's recently been merged.

Note that currently you can't nest scan/pause/scan/pause blocks - see #43

@geshwho
Copy link
Contributor Author

geshwho commented Jun 22, 2022

@oskarpearson Oh nice! This is great, and also looks like my next two questions are also being considered:

  • having the block return the results
  • nesting blocks

Let me know if I can do anything to help. Looking forward to both of these!

@geshwho
Copy link
Contributor Author

geshwho commented Jul 6, 2022

@oskarpearson @charkost I saw that these changes have all landed on main. Any chance you're able to cut a new release of this gem soon? I'm anxious to get my hands on block syntax 😅

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