0.3.0
This release adds significant new functionality and also contains many breaking changes. Big thanks to @amomchilov for all of the work he contributed to this release.
New functionality
- XPC services: create a server with
XPCServer.forThisXPCService()
and communicate with it usingXPCClient.forXPCService(named:)
. - Anonymous XPC: useful for testing and some advanced multiprocess communication scenarios.
- Swift concurrency:
await
sends from the client and registerasync
routes with the server side (available on macOS 10.15 and later). - A server's dispatch queue can now be set.
- Endpoints can be retrieved for anonymous and XPC Mach servers, optionally sent over another XPC connection, and used to create clients.
- Anonymous and XPC Mach servers can be started in a non-blocking manner.
- Improved error types and messages.
Changes
- XPC Mach servers are now retrieved with
XPCServer.forThisBlessedHelperTool()
orXPCServer.forThisMachService(named:clientRequirements:)
. - To start a server in a blocking manner, use
startAndBlock()
.start()
now starts the server and then returns. - XPC Mach clients are now retrieved with
XPCClient.forMachService(named:)
. - The client's
send
andsendMessage
functions which do not receive a reply must now either provide anonCompletion
handler or explicitly pass innil
to indicate they do not want to be informed of completion or any errors. - The clients
send
andsendMessage
functions which receive a reply have had theirwithReply
parameter renamed towithResponse
. - The client's
send
andsendMessage
functions no longerthrow
; all errors are passed to either theonCompletion
orwithResponse
handler. - Routes are now constructed with a builder pattern, for example:
XPCRoute.named("bedazzle").withMessageType(String.self).withReplyType(Bool.self)
Other additions
- Over 100 tests have been added.