Skip to content

✨ Add on_client_connected to Session.open, to allow for synchronization #747

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

Closed
wants to merge 1 commit into from
Closed

✨ Add on_client_connected to Session.open, to allow for synchronization #747

wants to merge 1 commit into from

Conversation

marianosimone
Copy link
Contributor

Description

Add a way for callers to get notified when a client gets connected to the debugger.

This solves Feature request: Stop debugger until first client connects · Issue #739 · ruby/debug.

A caller can now do something like:

client_connected = Concurrent::IVar.new
DEBUGGER__.open(nonstop: true, on_client_connected: -> {client_connected.set(true)})
client_connected.wait()

Additional context

We are working to integrate debug.rb into Stripe's Ruby test runner. The test runner needs to start the server and wait for VS Code to connect before running the tests.

debug/open does not work for this use case, as it pauses the program when the debugger starts, but does not resume the program after VS Code connects. Instead, VS Code reports the program as paused on a breakpoint in our test runner code. The user then has to hit "resume" to run their tests and hit the breakpoints that they actually set.

@marianosimone marianosimone closed this by deleting the head repository Oct 25, 2022
@marianosimone marianosimone reopened this Oct 25, 2022
@marianosimone
Copy link
Contributor Author

Closing in favor of #792

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