Skip to content

Commit

Permalink
increased concurrent sample to 100, and modified SpaceTuple a bit to …
Browse files Browse the repository at this point in the history
…not go to Array.Empty but return the string "()" right away
  • Loading branch information
Ledjon Behluli authored and Ledjon Behluli committed Jul 22, 2023
1 parent e707fd8 commit 6ba4772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/03_Concurrent/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

const string EXCHANGE_KEY = "exchange-key";

await Task.WhenAll(CreateTasks(10, async index =>
await Task.WhenAll(CreateTasks(100, async index =>
{
SpaceTuple tuple = new(EXCHANGE_KEY, index);
await agent.WriteAsync(tuple);
Expand All @@ -31,7 +31,7 @@ await Task.WhenAll(CreateTasks(10, async index =>
Console.WriteLine("----------------------");


await Task.WhenAll(CreateTasks(10, async index =>
await Task.WhenAll(CreateTasks(100, async index =>
{
SpaceTuple tuple = await agent.PeekAsync(new(EXCHANGE_KEY, index));
Console.WriteLine($"READER {index}: {tuple}");
Expand Down
2 changes: 1 addition & 1 deletion src/OrleanSpaces/Tuples/SpaceTuple.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public bool Equals(SpaceTuple other)
}

public override int GetHashCode() => fields?.GetHashCode() ?? 0;
public override string ToString() => $"({string.Join(", ", fields ?? Array.Empty<object>())})";
public override string ToString() => fields is null ? "()" : $"({string.Join(", ", fields)})";

/// <summary>
/// Returns an enumerator to enumerate over the fields of this tuple.
Expand Down

0 comments on commit 6ba4772

Please sign in to comment.