EightyDecibel.AsyncNats 0.8.3

A Nats.IO client specifically written with new C# features in mind. Internally it uses the new System.IO.Pipelines and System.Threading.Channels libraries that were released last year. It also uses the new IAsyncEnumerable as a way to listen to messages published to subjects.

The end result is very fast Nats.io client that, in our opinion, fits the C# 8.0 language features better than the currently existing libraries.

There is a newer version of this package available.
See the version list below for details.
Install-Package EightyDecibel.AsyncNats -Version 0.8.3
dotnet add package EightyDecibel.AsyncNats --version 0.8.3
<PackageReference Include="EightyDecibel.AsyncNats" Version="0.8.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EightyDecibel.AsyncNats --version 0.8.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EightyDecibel.AsyncNats, 0.8.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install EightyDecibel.AsyncNats as a Cake Addin
#addin nuget:?package=EightyDecibel.AsyncNats&version=0.8.3

// Install EightyDecibel.AsyncNats as a Cake Tool
#tool nuget:?package=EightyDecibel.AsyncNats&version=0.8.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

v0.8.3

  • Publish (PUB) was reserving one byte too much when payload was 9, 99, 999, 9999, 99999, 999999 bytes large
  • Unsubscribe (UNSUB) was reserving one byte too much when max messages was 9, 99, 999, 9999, 99999, 999999

v0.8.2

  • Refactored Subscribe a little bit
  • Added a missing memory-rent which could corrupt memory in high message volumes
  • Changed from ArrayPool to a custom MemoryPool to improve overal performance

v0.8.1

  • Upgraded dependencies
  • Fixed a small issue with System.IO.Pipelines

v0.8.0

  • Breaking change: Rewrote subscriptions to make them a bit easier to use
  • Breaking change: Removed "SubscribeAll", it made the process loop more difficult and wasn't of much use
  • Slightly increased performance of message process loop
  • The RPC Server proxy would eat exceptions if tasks got executed by the task scheduler/factory
  • All deserialize and RPC server exceptions are now passed to ConnectionException event handler

v0.7.1

  • Pipe did not support multiple simultaneous WriteAsync's, rewrote to use Channel instead with an internal 1Mb socket buffer (it's actually faster)

v0.7.0

  • Reduced amount of queue's inside the connection
  • Made amount of queue'd bytes visible in SenderQueueSize and ReceiverQueueSize properties
  • Added CancellationToken to internal publish methods

v0.6.5

  • Fixed an issue where the send/receive loop task would get executed synchroniously instead of asynchroniously

v0.6.4

  • Added optional TaskScheduler parameter to StartContractServer to make the "Server" run task concurrently
  • Added CancellationToken to all Async methods

v0.6.3

  • Added fire and forget methods (add NatsFireAndForget attribute to the methods), the caller doesn't wait for an answer. Note, exceptions thrown inside fire and forget methods will be lost!
  • An exception will be thrown when ValueTask is used as a contract type

v0.6.2

  • Updated InterfaceAsyncNatsSample to use a custom serializer (MessagePack)
  • Fixed an issue when MessagePack was used as serializer (and possible others)
  • Added DataContract / DataMember attributes to request/response classes used by the RPC functionality to aid MessagePack (and possible others)

v0.6.1

  • Forgot to add StartContractServer to the interface
  • Dispose the contract server channel once done (due to cancellation or exception)

v0.6

  • Added RPC functionality using interface contracts (see InterfaceAsyncNatsSample)

v0.8.3

  • Publish (PUB) was reserving one byte too much when payload was 9, 99, 999, 9999, 99999, 999999 bytes large
  • Unsubscribe (UNSUB) was reserving one byte too much when max messages was 9, 99, 999, 9999, 99999, 999999

v0.8.2

  • Refactored Subscribe a little bit
  • Added a missing memory-rent which could corrupt memory in high message volumes
  • Changed from ArrayPool to a custom MemoryPool to improve overal performance

v0.8.1

  • Upgraded dependencies
  • Fixed a small issue with System.IO.Pipelines

v0.8.0

  • Breaking change: Rewrote subscriptions to make them a bit easier to use
  • Breaking change: Removed "SubscribeAll", it made the process loop more difficult and wasn't of much use
  • Slightly increased performance of message process loop
  • The RPC Server proxy would eat exceptions if tasks got executed by the task scheduler/factory
  • All deserialize and RPC server exceptions are now passed to ConnectionException event handler

v0.7.1

  • Pipe did not support multiple simultaneous WriteAsync's, rewrote to use Channel instead with an internal 1Mb socket buffer (it's actually faster)

v0.7.0

  • Reduced amount of queue's inside the connection
  • Made amount of queue'd bytes visible in SenderQueueSize and ReceiverQueueSize properties
  • Added CancellationToken to internal publish methods

v0.6.5

  • Fixed an issue where the send/receive loop task would get executed synchroniously instead of asynchroniously

v0.6.4

  • Added optional TaskScheduler parameter to StartContractServer to make the "Server" run task concurrently
  • Added CancellationToken to all Async methods

v0.6.3

  • Added fire and forget methods (add NatsFireAndForget attribute to the methods), the caller doesn't wait for an answer. Note, exceptions thrown inside fire and forget methods will be lost!
  • An exception will be thrown when ValueTask is used as a contract type

v0.6.2

  • Updated InterfaceAsyncNatsSample to use a custom serializer (MessagePack)
  • Fixed an issue when MessagePack was used as serializer (and possible others)
  • Added DataContract / DataMember attributes to request/response classes used by the RPC functionality to aid MessagePack (and possible others)

v0.6.1

  • Forgot to add StartContractServer to the interface
  • Dispose the contract server channel once done (due to cancellation or exception)

v0.6

  • Added RPC functionality using interface contracts (see InterfaceAsyncNatsSample)

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.8.5 105 2/5/2021
0.8.4 234 10/30/2020
0.8.3 271 7/28/2020
0.8.2 184 7/28/2020
0.8.1 175 7/27/2020
0.8.0 174 7/24/2020
0.7.1 204 7/6/2020
0.7.0 314 7/6/2020
0.6.5 157 6/30/2020
0.6.4 223 2/24/2020
0.6.3 198 2/5/2020
0.6.2 215 2/5/2020
0.6.0 199 1/31/2020
0.5.1 223 11/10/2019
0.5.0 223 11/8/2019
0.4.0 217 10/20/2019
0.3.0 215 10/17/2019
0.2.0 214 10/16/2019
0.1.0 247 10/16/2019