Skip to content

Playwright dev branch no longer Send (thread safe) after this line of code. #38

@randall-coding

Description

@randall-coding

Conditions: I'm running playwright (dev branch) in two parallel threads like so:

tokio::spawn(job_x); 
tokio::spawn(job_y); 

Error: Compilation error occurs saying Playwright is not Send.

std::marker::Send is not implemented for std::sync::MutexGuard<'_, playwright::"imp"::core::connection::Context>
./src/imp/playwright.rs:76:17

Diagnosis: I was able to narrow it down to this line of code std::mem::drop(ctx); in imp/playwright.rs

Partial Solution: After removing that line of code it will compile 👍 . However, though playwright works, it will hang indefinitely after I close the browser window and I have to kill the program manually. I'm not 100% sure it is from removing that line or not yet, but it seems likely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions