0.4.0
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 anXPCRoute
(doing so is optional) and they'll be decoded by the client. This is highly convenient when using theasync
send messages as the error itself will be throw. When using the closure based variants the error will be encapsulated within aHandlerError
. - An
async
closure/function can now be used as the error handler for anXPCServer
. - Within a closure registered with and called by an
XPCServer
the newly addedXPCRequestContext
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 forXPCClient
'ssend
andsendMessage
functions have been renamed toto
. Otherwise functionality remains unchanged. - To add an error handler to an
XPCServer
instead of assigning a closure toerrorHandler
, it must now be added using thesetErrorHandler
function. There are two variants of this function with identical names: one forasync
and one for "standard" synchronous closures. - The
XPCError.other
case no longer exists.