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

Deprecate connect() in favour of IpcConnector #380

Closed
wants to merge 3 commits into from

Conversation

glyn
Copy link
Contributor

@glyn glyn commented Jan 23, 2025

This draft pull request prototypes a replacement for connect() with its unpredictable behaviour when called more than once per one-shot server.

Introduce IpcConnector as a means of forcing at most one connect request to a one-shot server.

For a smooth upgrade experience, deprecate new() and connect() in favour of new_with_connector() and its connect() method, respectively.

new() will be deleted in a future release at which point new_with_connector() could be renamed new().

Note that new_with_connector() does not support all the usecases of new(), but should be sufficient for Servo. In particular, it does not support launching a process passing the name of a one-shot server to which the process may then connect.

Ref: #378

glyn added 2 commits January 22, 2025 10:15
Introduce IpcConnector as a means of forcing
at most one connect request to a one-shot server.

For a smooth upgrade experience, deprecate new()
and connect() in favour of new_with_connector()
and its connect() method, respectively.

new() will be deleted in a future release at
which point new_with_connector() could be renamed
new().

Note that new_with_connector() does not support
all the usecases of new(), but should be
sufficient for Servo. In particular, it does not
support launching a process passing the name of a
one-shot server to which the process may then
connect.

Ref: servo#378
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

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

Ah, this is an interesting idea! This only works with the fork model though, right? Otherwise there's no way to move the connector into a child process—Servo spawns a process and passes the token as a command line argument.

@glyn
Copy link
Contributor Author

glyn commented Jan 24, 2025

Ah, this is an interesting idea! This only works with the fork model though, right? Otherwise there's no way to move the connector into a child process—Servo spawns a process and passes the token as a command line argument.

Yes, this only works with fork. Closing, but I think it would be worth capturing the spawn usecase in a testcase in this repo.

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