Skip to content

0.4.0

Compare
Choose a tag to compare
@jakaplan jakaplan released this 20 Mar 11:27
· 148 commits to main since this release

This release adds a bit of new functionality and also contains some minor breaking changes. Continued thanks to @amomchilov for all of his contributions and code reviews.

New functionality

  • Support for all custom errors so long as they're Codable. Simply define them as part of an XPCRoute (doing so is optional) and they'll be decoded by the client. This is highly convenient when using the async send messages as the error itself will be throw. When using the closure based variants the error will be encapsulated within a HandlerError.
  • An async closure/function can now be used as the error handler for an XPCServer.
  • Within a closure registered with and called by an XPCServer the newly added XPCRequestContext can be used to access information about the request's client process. Usage of this information is entirely optional and likely not needed by most daemons and applications.

Breaking changes

  • All of the route named parameters for XPCClient's send and sendMessage functions have been renamed to to. Otherwise functionality remains unchanged.
  • To add an error handler to an XPCServer instead of assigning a closure to errorHandler, it must now be added using the setErrorHandler function. There are two variants of this function with identical names: one for async and one for "standard" synchronous closures.
  • The XPCError.other case no longer exists.