Designing XPCAnonymousServer.start()
#29
Replies: 2 comments
-
|
Edit: The below is worth considering, but I think #30 is the most promising approach I've come up with. I'm assuming Here are some ideas, will keep brainstorming. Take these more as inspiration then as fully thought through ideas. Behavior differs,
|
Beta Was this translation helpful? Give feedback.
-
|
All of the above have varying degrees of merit, but I think #30 is more promising. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
XPCAnonymousServercan't fulfill the existing semantives offunc start() -> Never.I need some ideas for how to design this API, for #24.
Here's my observations of the existing usages:
XPCMachServicexpc_connection_resumeis called fromstart()callsstart()then also callsdispatchMain, which blocks.XPCClientServicestart()callsxpc_main, which blocks.XPCAnonymousServer(in the way it looks like in Add support for anonymous connections #24 right now)xpc_connection_resumeis called in the initializer. This seems out of place, I think this should be lazily deferred.xpc_connection_resumefromstart()if I could, if it wasn'tNever()returning.I like the idea that any kind of server requires a
server.start(), but it looks like there are conflicting requirements. It has to be blocking forXPCClientService, it should probably be blocking forXPCMachService(though doesn't strictly need to be), and it shouldn't be blocking forXPCAnonymousServer.I guess we need to split off two separate methods? If so, one or the other will have a
fatalError()implementation, which is usually an indication of a poorly designed class hierarchy.Got ideas?
Beta Was this translation helpful? Give feedback.
All reactions