Skip to content

Release async-nats/v0.33.0

Compare
Choose a tag to compare
@Jarema Jarema released this 07 Nov 10:47
· 109 commits to main since this release

0.33.0

Overview

This release introduces last planned breaking changes and stabilizes the async API.

Subject in publish methods

The biggest change is how subjects are handled. Until now, publish was of type String:

client.publish("subject".to_string(), "data".into()).await?;

This was easy to understand and reason about, but had two downsides:

  1. It was always allocating
  2. It was cumbersome for codebases working with &'static str

The signature has been change into:

// Signature
async fn publish(subject: impl ToSubject, payload: Bytes)
// Usage
client.publish("subject", "data".into()).await?;

This is not only more concise, but also allows avoiding allocations when subject is static,
or when it is Subject type that can be cheaply cloned leveraging memory optimized bytes::Bytes mechanism under the hood.

Service API improvements

Beyond that, there were a lot of improvements to Service API to address cross-language compatibility issues.
All structures are now tested against common cross-language json schemas.
Thanks @jadamcrain for all the feedback, issues nad PRs related to Service API!

Docs improvements

Despite every method having documentation with examples, we were aware that sometimes its hard to navigate the docs to find what someone is looking for.
This was addressed by adding module-level docs.

Added

Changed

Fixed

Misc

New Contributors

Full Changelog: async-nats/v0.32.0...async-nats/v0.33.0