Changelog
Source:NEWS.md
zugrpc 0.1.0
First release.
grpc_bearer_token()andgrpc_call_credentials()make call credentials, passed asgrpc_channel(credentials =). The secret stays in the R session: a channel or stream that is saved, or sent to another process, carries no token, and a copy there refuses calls until it is created again. A provider runs before every call, so a token can be refreshed. Credentials need TLS or a loopback host.headers, and aclient’s headers, no longer acceptauthorization(#56).Metadata named
r,reorreqis sent, instead of failing the call with an error from zuhttp (#81).A metadata name given more than once is
zugrpc_error_argument, raised bygrpc_channel()for channel headers, instead of an error from zuhttp at call time. An emptyuser-agentno longer adds a leading space (#82).Requests no longer ask for HTTP content coding (
accept-encoding: gzip), and a response with one is not decoded.content-lengthandaccept-encodingare reserved names. A client passed togrpc_channel()may not set a reserved header, and itsqueryis dropped (#83).grpc_channel()refuses a URL whose host or port cannot be used, withzugrpc_error_argument, instead of every call failing asUNAVAILABLE(#84).grpc_keepalive()refuses values outside 1 ms to 2147483.647 s, which zuhttp would refuse or clamp, and prints its values in full (#85).A positive deadline below a femtosecond is sent as
1n, not0n(#87).A stream decides its status as a unary call does. A status in the headers counts only when no body came, a status in the trailers wins over a body that ends inside a message, and an
OKstatus in the headers no longer makes an HTML body acceptable. The not-gRPC error keeps the first 1 KiB of the body (#58).A stream returns the complete messages that arrived before a broken one, then raises, however the server’s bytes were split (#76).
A warning while a stream ends, such as from undecodable
-bintrailers, can no longer make a failed stream read as a clean end (#77).A unary response larger than
max_messageis stillUNAVAILABLEfor a 503 and a protocol error for a body that is not gRPC, instead ofRESOURCE_EXHAUSTED. Its condition carrieshttp_status(#79).One error detail that does not decode no longer discards the whole
google.rpc.Status. It is kept as it came, with a warning (#80).A stream’s
$status()names how it ended, such as"CANCELLED"or"DEADLINE_EXCEEDED", and a stream of a closed channel prints as cancelled (#86).A comma-joined
-binvalue with a trailing comma gives an empty last value, as a leading comma gives an empty first one (#88).A call or stream with no deadline no longer fails with
DEADLINE_EXCEEDEDafter 30 seconds, zuhttp’s default timeout (#23).A server’s malformed
grpc-messageor-binmetadata no longer hides the call’s status. A-binvalue that is not base64 is dropped with azugrpc_warning_metadatawarning, and comma-joined values are split (#25, #26).grpc_close()no longer closes the connections of thezuhttpclient a channel was built on, or of other channels built on it (#27).Every condition of a call carries
method, andhttp_statusonce there is a response (#28).A stream that failed raises the same condition on every later
$next_message(), instead of reading as a clean end (#35).Metadata named
host, or a connection header HTTP/2 forbids, is an argument error. Auser-agentyou set is sent before zugrpc’s own instead of being replaced (#36).A method name must use protobuf name characters (#50).
Reading many small messages from a stream no longer slows down with the number in each read (#34).
grpc_channel()opens a channel to a gRPC server over cleartext HTTP/2 (http://) or TLS (https://). It can build on azuhttp::zu_client()you supply, so proxies, TLS settings and test transports carry over.grpc_close()closes it.grpc_call()makes a unary call. It returns the response message with its initial and trailing metadata, and raiseszugrpc_error_status, with a class per status code, when the call fails. Responses that are not gRPC or break its framing raisezugrpc_error_protocol.A failed call’s condition carries
details, thegoogle.rpc.Statusdecoded from thegrpc-status-details-bintrailer, with each error detail such asErrorInfounpacked. A trailer that does not decode is azugrpc_warning_detailswarning, and the status is kept.grpc_stream()makes a server-streaming call. Its$next_message()returns one message at a time as it arrives, so the server sends only as fast as you read.$cancel()stops the call and keeps the connection.grpc_close()cancels a channel’s open streams, and a stream that is no longer referenced is cancelled when it is garbage-collected.A call whose deadline has already passed fails with
DEADLINE_EXCEEDEDwithout being sent.grpc_keepalive()sets HTTP/2 keepalive for a channel. By default a connection idle for 60 seconds is checked with a PING before its next call, as Spark Connect’s Python client does.Each call no longer spends about a millisecond rebuilding the user-agent string.
zugrpc_info()reports the zuhttp version, whether it speaks HTTP/2, and its TLS backend.Failures below gRPC raise
zugrpc_error_transport, which is alsozugrpc_error_unavailable. A timeout isDEADLINE_EXCEEDED, and an interrupt raiseszugrpc_error_interrupt.grpc_status_codes()lists the 17 gRPC status codes.The gRPC wire format, internal for now: message framing, metadata with
-binvalues in base64, thegrpc-timeoutheader,grpc-statusandgrpc-messagedecoding, and the HTTP-status fallback.