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

Move to lazy init. #4092

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Move to lazy init. #4092

wants to merge 1 commit into from

Conversation

afourney
Copy link
Member

@afourney afourney commented Nov 8, 2024

Why are these changes needed?

Related issue number

Checks

Copy link
Contributor

@husseinmozannar husseinmozannar left a comment

Choose a reason for hiding this comment

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

why remove the arguments from init (_lazy_init), there are many scenarios where you launch the browser outside of websurfer and pass it as argument (e.g., webby)

@afourney
Copy link
Member Author

afourney commented Nov 8, 2024

why remove the arguments from init (_lazy_init), there are many scenarios where you launch the browser outside of websurfer and pass it as argument (e.g., webby)

The parameters are added to the constructor. If we want to instantiate it outside and pass a reference, we should do that in the constructor too (in which case things are easier and we don't need lazy init at all)

Lazy init exists because the playwright code is async, and cannot be called from the constructor.... so we wait to do it on the first message

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.

2 participants