json_rpc_2 3.0.2 json_rpc_2: ^3.0.2 copied to clipboard
Utilities to write a client or server using the JSON-RPC 2.0 spec.
- Switch to using
- Address a few analysis hint violations.
- Populate the pubspec
- Fix a bug where a
nullresult to a request caused an exception.
- Migrate to null safety.
- Accept responses even if the server converts the ID to a String.
Bad state: Future already completed.
Peerrequests not terminating when the underlying channel is closed.
strictProtocolChecksnamed parameter to
Peerconstructors. Setting this parameter to false will result in the server not rejecting requests missing the
- Fixed issue where throwing
RpcException.methodNotFoundin an asynchronous fallback handler would not result in the next fallback being executed.
- Updated minimum SDK to Dart
Serverand related classes can now take an
onUnhandledErrorcallback to notify callers of unhandled exceptions.
- Updated SDK version to 2.0.0-dev.17.0
- When a
Clientis closed before a request completes, the error sent to that request's
Futurenow includes the request method to aid in debugging.
- Internal changes only.
- Internal changes only.
Client.sendRequest()now throws a
StateErrorif the client is closed while the request is in-flight. This avoids dangling
Futures that will never be completed.
StateErrors if they're called after the client is closed.
- Fix new strong-mode warnings.
- Fix all strong-mode warnings.
- Fix a race condition in which a
StateErrorcould be top-leveled if
Peer.close()was called before the underlying channel closed.
Breaking change: all constructors now take a
StreamChannelrather than a
Client.sendNotification()no longer throw
StateErrors after the connection has been closed but before
Client.close()has been called.
close()methods may now be called before their corresponding
close()methods now wait on the result of closing the underlying
StreamSink. Be aware that in some circumstances
Sink.close()futures may never complete.
Server.isClosed, which make it possible to synchronously determine whether the connection is open. In particular, this makes it possible to reliably tell whether it's safe to call
Fix a race condition in
StateErrorcould be thrown if the connection was closed in the middle of handling a request.
Improve stack traces for error responses.
- Update the README to match the current API.
- Add a
Clientclass for communicating with external JSON-RPC 2.0 servers.
Peerclass that's both a
new Server()takes a
StreamSinkand uses those behind-the-scenes for its communication.
Server.listen(), which causes the server to begin listening to the underlying request stream.
Server.close(), which closes the underlying request stream and response sink.
- Widen the version constraint for
- Fix error response to include data from
RpcExceptionwhen not a map.