-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* JetStream preview release * Fixes to error handler interface * Stream delete interface * JetStream list api response exposed Exposed list APIs respond object to make paging possible. A paging extension can be implemented separately if needed. * Renamed Consume and Fetch interfaces * JetStream API review * Consume and fetch error handling removes * Consume and fetch now throws exception on JS terminal errors * Removed ErrorHandler option * Async enumerable initial List implementation * Domain option added to JSOpts * Logging improvements for testing * Option validations now throw exception * Removed inbox prefix from JS Opts * Also fixed typo in NatsJSOptsDefaults * Pack JetStream to publish
- Loading branch information
Showing
27 changed files
with
451 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading.Channels; | ||
|
||
namespace NATS.Client.JetStream; | ||
|
||
public interface INatsJSConsume : IAsyncDisposable | ||
{ | ||
void Stop(); | ||
} | ||
|
||
public interface INatsJSConsume<T> : INatsJSConsume | ||
{ | ||
ChannelReader<NatsJSMsg<T?>> Msgs { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Threading.Channels; | ||
|
||
namespace NATS.Client.JetStream; | ||
|
||
public interface INatsJSFetch : IAsyncDisposable | ||
{ | ||
void Stop(); | ||
} | ||
|
||
public interface INatsJSFetch<T> : INatsJSFetch | ||
{ | ||
ChannelReader<NatsJSMsg<T?>> Msgs { get; } | ||
} |
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
src/NATS.Client.JetStream/Internal/NatsJSExtensionsInternal.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
using NATS.Client.Core; | ||
|
||
namespace NATS.Client.JetStream.Internal; | ||
|
||
public static class NatsJSExtensionsInternal | ||
{ | ||
public static long ToNanos(this TimeSpan timeSpan) => (long)(timeSpan.TotalMilliseconds * 1_000_000); | ||
|
||
public static bool HasTerminalJSError(this NatsHeaders headers) => headers | ||
is { Code: 400 } | ||
or { Code: 409, Message: NatsHeaders.Messages.ConsumerDeleted } | ||
or { Code: 409, Message: NatsHeaders.Messages.ConsumerDeleted }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.