Skip to content

0.3.0

Compare
Choose a tag to compare
@jakaplan jakaplan released this 25 Jan 06:20
· 176 commits to main since this release
888c5a3

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 using XPCClient.forXPCService(named:).
  • Anonymous XPC: useful for testing and some advanced multiprocess communication scenarios.
  • Swift concurrency: await sends from the client and register async 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() or XPCServer.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 and sendMessage functions which do not receive a reply must now either provide an onCompletion handler or explicitly pass in nil to indicate they do not want to be informed of completion or any errors.
  • The clients send and sendMessage functions which receive a reply have had their withReply parameter renamed to withResponse.
  • The client's send and sendMessage functions no longer throw; all errors are passed to either the onCompletion or withResponse 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.