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

Feature: Support SIGHUP and SIGBREAK (port libuv support?) #16298

Open
tamusjroyce opened this issue Oct 15, 2022 · 9 comments
Open

Feature: Support SIGHUP and SIGBREAK (port libuv support?) #16298

tamusjroyce opened this issue Oct 15, 2022 · 9 comments
Labels
feat new feature (which has been agreed to/accepted)

Comments

@tamusjroyce
Copy link

tamusjroyce commented Oct 15, 2022

As deno ramps up to become compatible with node, is there an effort for porting libuv wrapper for console signals from libuv to a rust library compatible with Tokio? Specifically, SIGHUP and SIGBREAK - specifically src/win/signalc?

microsoft/playwright#3146

Thanks for any input on effort towards this. libuv doesn't have to be the source. And this may be a small step towards getting libraries like puppeteer and playwright to work. And other libraries, like https://github.com/atroche/rust-headless-chrome, may supersede the need for these two.

Or possible compatibly on how libuv and tokio setup websockets.

There are two ways for playwright and puppeteer to communicate with chrome/edge. websockets or signals & streams.

Thank you!
-TamusJRoyce

@tamusjroyce
Copy link
Author

@jeroendee
Copy link

jeroendee commented Nov 14, 2022

@bartlomieju as per your request in your talk: State of Deno 2022 before I create a new issue requesting for Playwright support in Deno... ;-)

@lucacasonato
Copy link
Member

lucacasonato commented Nov 14, 2022

Do you have a specific example of what code does not work right now, that you think should? Deno already supports sending SIGHUP and SIGBREAK signals to child processes (through child.kill("SIGHUP"))

@d4h0
Copy link

d4h0 commented Nov 14, 2022

@lucacasonato: Here is a snippet that I've tried previously (not tested with the current Deno release):

import { chromium } from 'npm:playwright';

async function main() {
  // const browser = await chromium.connectOverCDP("ws://127.0.0.1:37305/devtools/browser/d8da9c70-6b9c-45a4-8582-c26095adb110");
  const browser = await chromium.launch({
    headless: false,
  });
  const page = await browser.newPage();
  await page.goto('http://example.com');
  await browser.close();
};

if (import.meta.main) {
  main()
}

Please see my comment in the above-mentioned issue in the Playwright repo, which contains more information (including the error message).

@d4h0
Copy link

d4h0 commented Dec 2, 2022

I've opened a new issue specifically about Playwright: #16899

@tamusjroyce
Copy link
Author

Do you have a specific example of what code does not work right now, that you think should? Deno already supports sending SIGHUP and SIGBREAK signals to child processes (through child.kill("SIGHUP"))

This isn't sending a SIGNUP to a child process. But rather. Listening to SIGHUP.

@tamusjroyce
Copy link
Author

tamusjroyce commented Dec 20, 2022

@tamusjroyce
Copy link
Author

tamusjroyce commented Jun 15, 2023

Any word on fixing the TODO on line 59 of https://github.com/marvinhagemeister/deno/blob/794ce1c691117242c41e796cd9f7600fbfb939dc/runtime/ops/signal.rs?

// TODO: CtrlClose could be mapped to SIGHUP but that needs a
// tokio::windows::signal::CtrlClose type, or something from a different crate

SIGHUP and SIGBREAK

Oh. I think SIGHUP is fine. It is just SIGBREAK on windows

@tamusjroyce
Copy link
Author

Heard that Deno 1.46 has this issue resolved. Will give it a try tonight.

If you find this is open past 9/1/2024, feel free to close this issue

@lucacasonato lucacasonato added feat new feature (which has been agreed to/accepted) and removed enhancement labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

No branches or pull requests

6 participants