Skip to content

3.2.0

Latest

Choose a tag to compare

@odrobnik odrobnik released this 28 Sep 20:19
faa74a0

A request handler that knows the request's id (#14). JSONRPCPeer.setHandlers(identifiedRequest:notification:) installs an IdentifiedRequestHandler, which is given (id, method, params): the id of the request it answers, the same one its reply goes out with.

  • Why: a handler given only method and params can't tell two requests alike in both apart, or tie a request to others by its id. Cocoanetics/SwiftACP#138 needs this to bind an agent's request to the prompt it was read for.
  • Nothing else changes: setHandlers(request:notification:) and RequestHandler stay as they are. The new method has its own label, so a setHandlers(request: nil, …) call site stays unambiguous. It's additive, so this ships as a minor.