Skip to content

Refactor async example to use main function - #56

Open
SSujitX wants to merge 3 commits into
tinyfish-io:mainfrom
SSujitX:main
Open

Refactor async example to use main function#56
SSujitX wants to merge 3 commits into
tinyfish-io:mainfrom
SSujitX:main

Conversation

@SSujitX

@SSujitX SSujitX commented Jun 6, 2026

Copy link
Copy Markdown

I just updated the example of usages.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fc3ecde5-b159-4a1e-a3b5-37faaab9be2e

📥 Commits

Reviewing files that changed from the base of the PR and between 157e138 and e2592d9.

📒 Files selected for processing (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

📝 Walkthrough

Walkthrough

The README's async usage example has been refactored from a synchronous-style top-level context manager pattern to a proper Python async pattern. The code now defines an async def main() coroutine that executes browser initialization, page setup, stealth invocation, navigation, screenshot capture, and cleanup. The coroutine is run via asyncio.run(main()) inside a standard if __name__ == "__main__": guard, establishing a clearer entry point and more idiomatic Python async usage.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring the async example to use a main function structure.
Description check ✅ Passed The description is related to the changeset, confirming that the example usages were updated.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Line 40: The snippet uses a synchronous context manager syntax "with
async_playwright() as p" which is incorrect; change it to use the asynchronous
context manager form "async with async_playwright() as p" (and ensure the
containing function is declared async) so the async_playwright() async context
manager is entered correctly—look for the "with async_playwright() as p"
occurrence in README.md or examples like stealth_mode.py and replace it with
"async with async_playwright() as p".
- Line 35: Replace the invalid Python import statement "import async" in the
README example with "import asyncio" so the example using asyncio.run(main())
executes; locate the README.md example where "import async" appears and update
it to "import asyncio", and ensure any references to the module in the snippet
(e.g., asyncio.run or asyncio.sleep) match the corrected import.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 237decce-19aa-49b0-92c1-244b60addbdb

📥 Commits

Reviewing files that changed from the base of the PR and between fd3ab72 and 157e138.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md Outdated
Comment thread README.md
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

Successfully merging this pull request may close these issues.

1 participant