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.
-
XPCAnonymousServer
can'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:
XPCMachService
xpc_connection_resume
is called fromstart()
callsstart()
then also callsdispatchMain
, which blocks.XPCClientService
start()
callsxpc_main
, which blocks.XPCAnonymousServer
(in the way it looks like in Add support for anonymous connections #24 right now)xpc_connection_resume
is called in the initializer. This seems out of place, I think this should be lazily deferred.xpc_connection_resume
fromstart()
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