Skip to content

Commit

Permalink
Fix simplification name case from from consume to Consume.
Browse files Browse the repository at this point in the history
  • Loading branch information
scottf committed Jun 23, 2023
1 parent d4e7fd6 commit be5d0a0
Show file tree
Hide file tree
Showing 8 changed files with 337 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/NATS.Client/JetStream/ConsumerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,21 @@ public Msg Next(int maxWaitMillis)
return new FetchConsumer(new SubscriptionMaker(js, bindPso), fetchConsumeOptions);
}

public IIterableConsumer consume() {
public IIterableConsumer Consume() {
return new IterableConsumer(new SubscriptionMaker(js, bindPso), DefaultConsumeOptions);
}

public IIterableConsumer consume(ConsumeOptions consumeOptions) {
public IIterableConsumer Consume(ConsumeOptions consumeOptions) {
Validator.Required(consumeOptions, "Consume Options");
return new IterableConsumer(new SubscriptionMaker(js, bindPso), consumeOptions);
}

public IMessageConsumer consume(EventHandler<MsgHandlerEventArgs> handler) {
public IMessageConsumer Consume(EventHandler<MsgHandlerEventArgs> handler) {
Validator.Required(handler, "Msg Handler");
return new MessageConsumer(new SubscriptionMaker(js, bindPso), handler, DefaultConsumeOptions);
}

public IMessageConsumer consume(EventHandler<MsgHandlerEventArgs> handler, ConsumeOptions consumeOptions) {
public IMessageConsumer Consume(EventHandler<MsgHandlerEventArgs> handler, ConsumeOptions consumeOptions) {
Validator.Required(handler, "Msg Handler");
Validator.Required(consumeOptions, "Consume Options");
return new MessageConsumer(new SubscriptionMaker(js, bindPso), handler, consumeOptions);
Expand Down
8 changes: 4 additions & 4 deletions src/NATS.Client/JetStream/IConsumerContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,29 @@ public interface IConsumerContext
/// Manual Consumers require the developer call nextMessage. See {@link IManualConsumer}
/// </summary>
/// <returns>the IManualConsumer instance</returns>
IIterableConsumer consume();
IIterableConsumer Consume();

/// <summary>
/// Create a long-running Manual Consumer with custom ConsumeOptions. See {@link IManualConsumer} and {@link ConsumeOptions}
/// Manual Consumers require the developer call nextMessage.
/// </summary>
/// <param name="consumeOptions">the custom consume options</param>
/// <returns>the IManualConsumer instance</returns>
IIterableConsumer consume(ConsumeOptions consumeOptions);
IIterableConsumer Consume(ConsumeOptions consumeOptions);

/// <summary>
/// Create a long-running MessageConsumer with default ConsumeOptions. See {@link IMessageConsumer} and {@link ConsumeOptions}
/// </summary>
/// <param name="handler">the MessageHandler used for receiving messages.</param>
/// <returns>the IMessageConsumer instance</returns>
IMessageConsumer consume(EventHandler<MsgHandlerEventArgs> handler);
IMessageConsumer Consume(EventHandler<MsgHandlerEventArgs> handler);

/// <summary>
/// Create a long-running MessageConsumer with custom ConsumeOptions. See {@link IMessageConsumer} and {@link ConsumeOptions}
/// </summary>
/// <param name="handler">the MessageHandler used for receiving messages.</param>
/// <param name="consumeOptions">the custom consume options</param>
/// <returns>the IMessageConsumer instance</returns>
IMessageConsumer consume(EventHandler<MsgHandlerEventArgs> handler, ConsumeOptions consumeOptions);
IMessageConsumer Consume(EventHandler<MsgHandlerEventArgs> handler, ConsumeOptions consumeOptions);
}
}
5 changes: 5 additions & 0 deletions src/NATS.Client/JetStream/Subject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ public Subject(string name, long count)
Name = name;
Count = count;
}

public override string ToString()
{
return $"{{Name: {Name}, Count: {Count}}}";
}
}
}
8 changes: 7 additions & 1 deletion src/Samples/Miscellany/Miscellany.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using NATSExamples.NatsByExample;

namespace NATSExamples
{
Expand All @@ -10,7 +11,7 @@ abstract class Miscellany
public static void Main(string[] args)
{
// Set the args manually to run the code you want.
// args = new[] { "PubSub" };
args = new[] { "SimplificationMigration" };

if (args.Length == 1)
{
Expand All @@ -35,6 +36,10 @@ public static void Main(string[] args)
case "ServiceCrossClientValidator":
ServiceCrossClientValidator.CrossClientValidationMain();
return;

case "SimplificationMigration":
SimplificationMigration.SimplificationMigrationMain();
return;
}
}

Expand All @@ -46,6 +51,7 @@ public static void Main(string[] args)
+ "\n KvIntro"
+ "\n ScatterGather"
+ "\n ServiceCrossClientValidator"
+ "\n SimplificationMigration"
);
}
}
Expand Down

0 comments on commit be5d0a0

Please sign in to comment.