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

XPCServer factory functions should always return the same instance #15

Closed
jakaplan opened this issue Nov 11, 2021 · 0 comments
Closed
Assignees

Comments

@jakaplan
Copy link
Contributor

Currently:

  • forThisXPCService() always returns the same instance
  • forThisBlessedHelperTool() and forThisMachService(...) return new instances each time

This inconsistency is undesirable as the server is stateful with routes and an error handler.

However, in practice this probably wouldn't be much of an issue as it's hard to envision why one of these functions would be called multiple times.

@jakaplan jakaplan changed the title XPCServer factory functions should always return the same instance XPCServer factory functions should always return the same instance Nov 11, 2021
@jakaplan jakaplan self-assigned this Nov 12, 2021
jakaplan pushed a commit that referenced this issue Nov 12, 2021
XPCMachServer now internally manages a cache of servers and returns an existing one when possible or throws an error if the requirements do not match. Adds "XPCServer Creation.swift" to test this behavior.

All language for the server as well as the client now refers to "retrieve" or "retrieving" instead of "create" or "creating".
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

No branches or pull requests

1 participant