Skip to content

v0.2.0

Compare
Choose a tag to compare
@pkwarren pkwarren released this 22 Sep 18:37
· 214 commits to main since this release
ea77fd5

What's Changed

Release v0.2.0 fixes issues seen with streaming calls and addresses compatibility with gRPC servers.

Although connect-kotlin is still in alpha, we try to maintain compatibility between releases. Some of the fixes however required API changes, which are documented below.

Bugfixes

Other changes

Full Changelog: v0.1.11...v0.2.0

API Updates

com.connectrpc.BidirectionalStreamInterface

Removed

  • close()
    • Use sendClose() instead. This may have confused callers that the close() method would close both send and receive sides of the connection when it was only closing the send side.

com.connectrpc.ClientOnlyStreamInterface

Added

  • sendClose()
    • This shouldn't typically need to be called as receiveAndClose() already closes the send side of the stream.
  • isSendClosed()

Changed

  • receiveAndClose()
    • Changed to return a ResponseMessage instead of a StreamResult. This allows callers to easily get access to the response as if they were calling a unary method. Previously, the StreamResult would only return the first result retrieved by the call, which typically was a Headers result (leaving callers unable to access the Message or Completion contents).

Removed

  • close()
    • Replaced with sendClose().

com.connectrpc.ServerOnlyStreamInterface

Added

  • receiveClose()
  • isReceiveClosed()

Removed

  • close()
    • This closed both the send and receive side of the stream (unlike in other interfaces which just closed the send side). If needed, callers should invoke receiveClose() instead (although this isn't necessary in normal use).
  • send()
    • Callers should invoke sendAndClose() instead. Otherwise, reading results from resultChannel() will hang since the send side of the stream should be closed before reading responses.

com.connectrpc.StreamResult

Removed

  • Removed the error field from the base StreamResult class. It was never used by the Headers or Message subclasses and only used on the Complete type. This should make it easier for callers to use Headers and Message types since they don't need to worry about handling error.