Skip to content

Commit 150a298

Browse files
Improve Sqs_8 prompts
1 parent 5344ef4 commit 150a298

File tree

1 file changed

+14
-12
lines changed
  • samples/aws/sqs-native-integration/Sqs_8/Sender

1 file changed

+14
-12
lines changed

samples/aws/sqs-native-integration/Sqs_8/Sender/Program.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,24 @@
1212

1313
while (true)
1414
{
15-
Console.WriteLine("Enter 's' to send a message, enter 'exit' to stop");
16-
var line = Console.ReadLine();
17-
switch (line?.ToLowerInvariant())
18-
{
19-
case "exit":
20-
return;
21-
case "s":
15+
Console.WriteLine("Press [s] to send a message or [ESC] to exit.");
16+
17+
var line = Console.ReadKey();
18+
Console.WriteLine();
2219

23-
#region SendingANativeMessage
24-
await SendTo(new Dictionary<string, MessageAttributeValue>
20+
if (line.Key == ConsoleKey.S)
21+
{
22+
#region SendingANativeMessage
23+
await SendTo(new Dictionary<string, MessageAttributeValue>
2524
{
2625
{"SomeKey", new MessageAttributeValue {DataType = "String", StringValue = "something"}}, //optional attributes that the receiver might need
2726
}, MessageToSend);
28-
#endregion
29-
Console.WriteLine("Message was sent.");
30-
break;
27+
#endregion
28+
Console.WriteLine("Message was sent.");
29+
}
30+
else if (line.Key == ConsoleKey.Escape)
31+
{
32+
return;
3133
}
3234
}
3335

0 commit comments

Comments
 (0)