This is an automated email from the ASF dual-hosted git repository.
hgruszecki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git
The following commit(s) were added to refs/heads/master by this push:
new 38bf2dc4c refactor(csharp): rename asynchronous methods to have Async
suffix (#2994)
38bf2dc4c is described below
commit 38bf2dc4cc7cac74fe2f7dd2c92dd09d350f7cf1
Author: Ćukasz Zborek <[email protected]>
AuthorDate: Sat Mar 21 12:12:21 2026 +0100
refactor(csharp): rename asynchronous methods to have Async suffix (#2994)
---
.../Iggy_SDK.Examples.Basic.Consumer/Program.cs | 2 +-
.../Iggy_SDK.Examples.Basic.Producer/Program.cs | 2 +-
.../Program.cs | 2 +-
.../Program.cs | 2 +-
.../Program.cs | 2 +-
.../Program.cs | 2 +-
.../Program.cs | 2 +-
.../Program.cs | 2 +-
.../Iggy_SDK.Examples.NewSdk.Consumer/Program.cs | 2 +-
.../Iggy_SDK.Examples.NewSdk.Producer/Program.cs | 4 +-
.../Iggy_SDK.Examples.NewSdk.Producer/Utils.cs | 2 +-
.../Iggy_SDK.Examples.TcpTls.Consumer/Program.cs | 2 +-
.../Iggy_SDK.Examples.TcpTls.Producer/Program.cs | 2 +-
foreign/csharp/Benchmarks/Program.cs | 2 +-
.../BasicMessagingOperationsSteps.cs | 2 +-
.../ClusterRedirectionTests.cs | 8 ++--
.../ConsumerGroupTests.cs | 2 +-
.../Fixtures/IggyServerFixture.cs | 4 +-
.../IggyPublisherTests.cs | 24 +++++------
.../IggyTlsConnectionTests.cs | 6 +--
.../PersonalAccessTokenTests.cs | 2 +-
.../Iggy_SDK.Tests.Integration/SystemTests.cs | 4 +-
.../Iggy_SDK.Tests.Integration/UsersTests.cs | 46 +++++++++++-----------
foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs | 10 ++---
.../Iggy_SDK/Contracts/Auth/GlobalPermissions.cs | 14 +++----
.../IggyClient/IIggyPersonalAccessToken.cs | 2 +-
foreign/csharp/Iggy_SDK/IggyClient/IIggyUsers.cs | 18 ++++-----
.../Implementations/HttpMessageStream.cs | 20 +++++-----
.../IggyClient/Implementations/TcpMessageStream.cs | 26 ++++++------
foreign/csharp/Iggy_SDK/Iggy_SDK.csproj | 2 +-
.../csharp/Iggy_SDK/Publishers/IggyPublisher.cs | 16 ++++----
.../csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs | 6 +--
foreign/csharp/README.md | 8 ++--
33 files changed, 125 insertions(+), 125 deletions(-)
diff --git
a/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Consumer/Program.cs
b/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Consumer/Program.cs
index ec36f02d1..627c35b89 100644
--- a/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Consumer/Program.cs
+++ b/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Consumer/Program.cs
@@ -45,7 +45,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser(settings.Username, settings.Password);
+await client.LoginUserAsync(settings.Username, settings.Password);
logger.LogInformation("Basic consumer has logged on successfully");
diff --git
a/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Producer/Program.cs
b/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Producer/Program.cs
index 57b239184..7d9caf79d 100644
--- a/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Producer/Program.cs
+++ b/examples/csharp/src/Basic/Iggy_SDK.Examples.Basic.Producer/Program.cs
@@ -46,7 +46,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser(settings.Username, settings.Password);
+await client.LoginUserAsync(settings.Username, settings.Password);
logger.LogInformation("Basic producer has logged on successfully");
diff --git
a/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Program.cs
b/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Program.cs
index f8719cf6b..12ec19887 100644
---
a/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Program.cs
+++
b/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Consumer/Program.cs
@@ -32,6 +32,6 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
await Utils.ConsumeMessages(client, logger);
diff --git
a/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Program.cs
b/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Program.cs
index 6eae150f1..93af609f2 100644
---
a/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Program.cs
+++
b/examples/csharp/src/GettingStarted/Iggy_SDK.Examples.GettingStarted.Producer/Program.cs
@@ -32,7 +32,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
await Utils.InitSystem(client, logger);
await Utils.ProduceMessages(client, logger);
diff --git
a/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Program.cs
b/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Program.cs
index a5204f42c..91632e58c 100644
---
a/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Program.cs
+++
b/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Consumer/Program.cs
@@ -32,6 +32,6 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
await Utils.ConsumeMessages(client, logger);
diff --git
a/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Program.cs
b/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Program.cs
index adbbce64a..cddb857ef 100644
---
a/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Program.cs
+++
b/examples/csharp/src/MessageEnvelope/Iggy_SDK.Examples.MessageEnvelope.Producer/Program.cs
@@ -32,7 +32,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
await Utils.InitSystem(client, logger);
await Utils.ProduceMessages(client, logger);
diff --git
a/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Program.cs
b/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Program.cs
index 45f5dd2fe..8ea9c62d6 100644
---
a/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Program.cs
+++
b/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Consumer/Program.cs
@@ -32,6 +32,6 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
await Utils.ConsumeMessages(client, logger);
diff --git
a/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Program.cs
b/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Program.cs
index 662726708..d2d820c9e 100644
---
a/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Program.cs
+++
b/examples/csharp/src/MessageHeaders/Iggy_SDK.Examples.MessageHeaders.Producer/Program.cs
@@ -32,7 +32,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
await Utils.InitSystem(client, logger);
await Utils.ProduceMessages(client, logger);
diff --git
a/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Consumer/Program.cs
b/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Consumer/Program.cs
index d384c2c7a..58ee8ad91 100644
--- a/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Consumer/Program.cs
+++ b/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Consumer/Program.cs
@@ -36,7 +36,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator()
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
var consumer =
client.CreateConsumerBuilder(Identifier.String("new-sdk-stream"),
Identifier.String("new-sdk-topic"),
Consumer.Group("new-sdk-consumer-group"))
diff --git
a/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Program.cs
b/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Program.cs
index d6bbf25ca..e76bdf792 100644
--- a/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Program.cs
+++ b/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Program.cs
@@ -34,7 +34,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
var publisher =
client.CreatePublisherBuilder(Identifier.String("new-sdk-stream"),
Identifier.String("new-sdk-topic"))
.CreateStreamIfNotExists("new-sdk-stream")
@@ -45,4 +45,4 @@ var publisher =
client.CreatePublisherBuilder(Identifier.String("new-sdk-stream"
await publisher.InitAsync();
await Utils.ProduceMessages(publisher, logger);
-await publisher.WaitUntilAllSends();
+await publisher.WaitUntilAllSendsAsync();
diff --git
a/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Utils.cs
b/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Utils.cs
index 1cee63eb1..4355b5c97 100644
--- a/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Utils.cs
+++ b/examples/csharp/src/NewSdk/Iggy_SDK.Examples.NewSdk.Producer/Utils.cs
@@ -71,7 +71,7 @@ public static class Utils
logger.LogInformation("Sending messages count: {Count}",
messagesPerBatch);
- await publisher.SendMessages(messages.ToArray());
+ await publisher.SendMessagesAsync(messages.ToArray());
sentBatches++;
logger.LogInformation("Sent messages: {Messages}",
serializableMessages);
diff --git
a/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Consumer/Program.cs
b/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Consumer/Program.cs
index fbc8aaaa7..431b5d9d9 100644
--- a/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Consumer/Program.cs
+++ b/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Consumer/Program.cs
@@ -60,7 +60,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
logger.LogInformation("Connected and logged in over TLS.");
await ConsumeMessages();
diff --git
a/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs
b/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs
index 49cf29a94..4033326da 100644
--- a/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs
+++ b/examples/csharp/src/TcpTls/Iggy_SDK.Examples.TcpTls.Producer/Program.cs
@@ -61,7 +61,7 @@ var client = IggyClientFactory.CreateClient(new
IggyClientConfigurator
});
await client.ConnectAsync();
-await client.LoginUser("iggy", "iggy");
+await client.LoginUserAsync("iggy", "iggy");
logger.LogInformation("Connected and logged in over TLS.");
await InitSystem();
diff --git a/foreign/csharp/Benchmarks/Program.cs
b/foreign/csharp/Benchmarks/Program.cs
index 9934d15fe..9c192f213 100644
--- a/foreign/csharp/Benchmarks/Program.cs
+++ b/foreign/csharp/Benchmarks/Program.cs
@@ -56,7 +56,7 @@ for (var i = 0; i < producerCount; i++)
#endif
});
- await bus.LoginUser("iggy", "iggy");
+ await bus.LoginUserAsync("iggy", "iggy");
clients[i] = bus;
}
diff --git
a/foreign/csharp/Iggy_SDK.Tests.BDD/StepDefinitions/BasicMessagingOperationsSteps.cs
b/foreign/csharp/Iggy_SDK.Tests.BDD/StepDefinitions/BasicMessagingOperationsSteps.cs
index 82bacbba0..17742645a 100644
---
a/foreign/csharp/Iggy_SDK.Tests.BDD/StepDefinitions/BasicMessagingOperationsSteps.cs
+++
b/foreign/csharp/Iggy_SDK.Tests.BDD/StepDefinitions/BasicMessagingOperationsSteps.cs
@@ -55,7 +55,7 @@ public class BasicMessagingOperationsSteps
[Given(@"I am authenticated as the root user")]
public async Task GivenIAmAuthenticatedAsTheRootUser()
{
- var loginResult = await _context.IggyClient.LoginUser("iggy", "iggy");
+ var loginResult = await _context.IggyClient.LoginUserAsync("iggy",
"iggy");
loginResult.ShouldNotBeNull();
loginResult.UserId.ShouldBe(0);
diff --git
a/foreign/csharp/Iggy_SDK.Tests.Integration/ClusterRedirectionTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/ClusterRedirectionTests.cs
index 1ea2c594c..1eafa8ea1 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/ClusterRedirectionTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/ClusterRedirectionTests.cs
@@ -40,7 +40,7 @@ public class ClusterRedirectionTests
AutoLoginSettings = new AutoLoginSettings { Enabled = false }
});
await client.ConnectAsync();
- await client.LoginUser("iggy", "iggy");
+ await client.LoginUserAsync("iggy", "iggy");
var metadata = await client.GetClusterMetadataAsync();
@@ -84,7 +84,7 @@ public class ClusterRedirectionTests
AutoLoginSettings = new AutoLoginSettings { Enabled = false }
});
await client.ConnectAsync();
- await client.LoginUser("iggy", "iggy");
+ await client.LoginUserAsync("iggy", "iggy");
var address = client.GetCurrentAddress();
address.ShouldNotBeNullOrEmpty();
@@ -103,7 +103,7 @@ public class ClusterRedirectionTests
AutoLoginSettings = new AutoLoginSettings { Enabled = false }
});
await leaderClient.ConnectAsync();
- await leaderClient.LoginUser("iggy", "iggy");
+ await leaderClient.LoginUserAsync("iggy", "iggy");
var name = $"pat-{Guid.NewGuid():N}"[..20];
var pat = await leaderClient.CreatePersonalAccessTokenAsync(name,
TimeSpan.FromHours(1));
@@ -117,7 +117,7 @@ public class ClusterRedirectionTests
AutoLoginSettings = new AutoLoginSettings { Enabled = false }
});
await client.ConnectAsync();
- var authResponse = await
client.LoginWithPersonalAccessToken(pat.Token);
+ var authResponse = await
client.LoginWithPersonalAccessTokenAsync(pat.Token);
authResponse.ShouldNotBeNull();
authResponse.UserId.ShouldBeGreaterThanOrEqualTo(0);
diff --git a/foreign/csharp/Iggy_SDK.Tests.Integration/ConsumerGroupTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/ConsumerGroupTests.cs
index aaf516140..ef7a88af5 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/ConsumerGroupTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/ConsumerGroupTests.cs
@@ -196,7 +196,7 @@ public class ConsumerGroupTests
{
var memberClient = await Fixture.CreateClient(Protocol.Tcp);
clients.Add(memberClient);
- await memberClient.LoginUser("iggy", "iggy");
+ await memberClient.LoginUserAsync("iggy", "iggy");
await
memberClient.JoinConsumerGroupAsync(Identifier.String(streamName),
Identifier.String(TopicName), Identifier.Numeric(cg!.Id));
}
diff --git
a/foreign/csharp/Iggy_SDK.Tests.Integration/Fixtures/IggyServerFixture.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/Fixtures/IggyServerFixture.cs
index b3f41dfcf..7d088dc7e 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/Fixtures/IggyServerFixture.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/Fixtures/IggyServerFixture.cs
@@ -174,7 +174,7 @@ public class IggyServerFixture : IAsyncInitializer,
IAsyncDisposable
if (connect)
{
- await client.LoginUser(userName, password);
+ await client.LoginUserAsync(userName, password);
}
return client;
@@ -184,7 +184,7 @@ public class IggyServerFixture : IAsyncInitializer,
IAsyncDisposable
{
var client = await CreateClient(Protocol.Http);
- await client.LoginUser(userName, password);
+ await client.LoginUserAsync(userName, password);
return client;
}
diff --git a/foreign/csharp/Iggy_SDK.Tests.Integration/IggyPublisherTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/IggyPublisherTests.cs
index 1f139e51c..15e4dad1b 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/IggyPublisherTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/IggyPublisherTests.cs
@@ -128,7 +128,7 @@ public class IggyPublisherTests
new(Guid.NewGuid(), Encoding.UTF8.GetBytes("Test message"))
};
- await Should.ThrowAsync<PublisherNotInitializedException>(() =>
publisher.SendMessages(messages));
+ await Should.ThrowAsync<PublisherNotInitializedException>(() =>
publisher.SendMessagesAsync(messages));
await publisher.DisposeAsync();
}
@@ -155,7 +155,7 @@ public class IggyPublisherTests
messages.Add(new Message(Guid.NewGuid(),
Encoding.UTF8.GetBytes($"Test message {i}")));
}
- await Should.NotThrowAsync(() => publisher.SendMessages(messages));
+ await Should.NotThrowAsync(() =>
publisher.SendMessagesAsync(messages));
// Verify messages were sent by polling them
var polledMessages = await client.PollMessagesAsync(
@@ -189,7 +189,7 @@ public class IggyPublisherTests
await publisher.InitAsync();
var emptyMessages = new List<Message>();
- await Should.NotThrowAsync(() =>
publisher.SendMessages(emptyMessages));
+ await Should.NotThrowAsync(() =>
publisher.SendMessagesAsync(emptyMessages));
await publisher.DisposeAsync();
}
@@ -320,8 +320,8 @@ public class IggyPublisherTests
messages.Add(new Message(Guid.NewGuid(),
Encoding.UTF8.GetBytes($"Background message {i}")));
}
- await publisher.SendMessages(messages);
- await publisher.WaitUntilAllSends();
+ await publisher.SendMessagesAsync(messages);
+ await publisher.WaitUntilAllSendsAsync();
// Verify messages were sent
var polledMessages = await client.PollMessagesAsync(
@@ -361,11 +361,11 @@ public class IggyPublisherTests
messages.Add(new Message(Guid.NewGuid(),
Encoding.UTF8.GetBytes($"Wait test message {i}")));
}
- await publisher.SendMessages(messages);
+ await publisher.SendMessagesAsync(messages);
// Should not return immediately
var startTime = DateTime.UtcNow;
- await publisher.WaitUntilAllSends();
+ await publisher.WaitUntilAllSendsAsync();
var elapsed = DateTime.UtcNow - startTime;
// Should have taken some time to flush
@@ -393,7 +393,7 @@ public class IggyPublisherTests
await publisher.InitAsync();
// Should return immediately without background sending
- await Should.NotThrowAsync(() => publisher.WaitUntilAllSends());
+ await Should.NotThrowAsync(() => publisher.WaitUntilAllSendsAsync());
await publisher.DisposeAsync();
}
@@ -424,7 +424,7 @@ public class IggyPublisherTests
Encoding.UTF8.GetBytes($"Partition {partitionId} message
{i}")));
}
- await publisher.SendMessages(messages);
+ await publisher.SendMessagesAsync(messages);
await publisher.DisposeAsync();
}
@@ -468,7 +468,7 @@ public class IggyPublisherTests
messages.Add(new Message(Guid.NewGuid(),
Encoding.UTF8.GetBytes($"Balanced message {i}")));
}
- await publisher.SendMessages(messages);
+ await publisher.SendMessagesAsync(messages);
// Verify messages are distributed across partitions
var totalMessages = 0;
@@ -610,8 +610,8 @@ public class IggyPublisherTests
messages.Add(new Message(Guid.NewGuid(),
Encoding.UTF8.GetBytes($"Large batch message {i}")));
}
- await publisher.SendMessages(messages);
- await publisher.WaitUntilAllSends();
+ await publisher.SendMessagesAsync(messages);
+ await publisher.WaitUntilAllSendsAsync();
// Verify at least most messages were sent
var polledMessages = await client.PollMessagesAsync(
diff --git
a/foreign/csharp/Iggy_SDK.Tests.Integration/IggyTlsConnectionTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/IggyTlsConnectionTests.cs
index ab54d354a..4b4200a74 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/IggyTlsConnectionTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/IggyTlsConnectionTests.cs
@@ -52,7 +52,7 @@ public class IggyTlsConnectionTests
});
await client.ConnectAsync();
- var loginResult = await client.LoginUser("iggy", "iggy");
+ var loginResult = await client.LoginUserAsync("iggy", "iggy");
loginResult.ShouldNotBeNull();
}
@@ -68,7 +68,7 @@ public class IggyTlsConnectionTests
});
await client.ConnectAsync();
- await
Should.ThrowAsync<IggyZeroBytesException>(client.LoginUser("iggy", "iggy"));
+ await
Should.ThrowAsync<IggyZeroBytesException>(client.LoginUserAsync("iggy",
"iggy"));
}
[Test]
@@ -94,7 +94,7 @@ public class IggyTlsConnectionTests
});
await client.ConnectAsync();
- var loginResult = await client.LoginUser("iggy", "iggy");
+ var loginResult = await client.LoginUserAsync("iggy", "iggy");
loginResult.ShouldNotBeNull();
}
diff --git
a/foreign/csharp/Iggy_SDK.Tests.Integration/PersonalAccessTokenTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/PersonalAccessTokenTests.cs
index 1029841f1..49b9aecef 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/PersonalAccessTokenTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/PersonalAccessTokenTests.cs
@@ -88,7 +88,7 @@ public class PersonalAccessTokenTests
var response = await client.CreatePersonalAccessTokenAsync(name,
Expiry);
var loginClient = await Fixture.CreateClient(protocol);
- var authResponse = await
loginClient.LoginWithPersonalAccessToken(response!.Token);
+ var authResponse = await
loginClient.LoginWithPersonalAccessTokenAsync(response!.Token);
authResponse.ShouldNotBeNull();
authResponse.UserId.ShouldBeGreaterThanOrEqualTo(0);
diff --git a/foreign/csharp/Iggy_SDK.Tests.Integration/SystemTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/SystemTests.cs
index e9563025c..40f1392b5 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/SystemTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/SystemTests.cs
@@ -57,7 +57,7 @@ public class SystemTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var tcpClient = await Fixture.CreateClient(Protocol.Tcp);
- await tcpClient.LoginUser("iggy", "iggy");
+ await tcpClient.LoginUserAsync("iggy", "iggy");
var clientInfo = await tcpClient.GetMeAsync();
clientInfo.ShouldNotBeNull();
@@ -105,7 +105,7 @@ public class SystemTests
var streamName = $"sys-cg-{Guid.NewGuid():N}";
var tcpClient = await Fixture.CreateClient(Protocol.Tcp);
- await tcpClient.LoginUser("iggy", "iggy");
+ await tcpClient.LoginUserAsync("iggy", "iggy");
var stream = await tcpClient.CreateStreamAsync(streamName);
await tcpClient.CreateTopicAsync(Identifier.String(streamName),
"first_topic", 2);
diff --git a/foreign/csharp/Iggy_SDK.Tests.Integration/UsersTests.cs
b/foreign/csharp/Iggy_SDK.Tests.Integration/UsersTests.cs
index 3f0a08e30..a74bec4cc 100644
--- a/foreign/csharp/Iggy_SDK.Tests.Integration/UsersTests.cs
+++ b/foreign/csharp/Iggy_SDK.Tests.Integration/UsersTests.cs
@@ -37,7 +37,7 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"user-{Guid.NewGuid():N}"[..20];
- var result = await client.CreateUser(username, "test_password_1",
UserStatus.Active);
+ var result = await client.CreateUserAsync(username, "test_password_1",
UserStatus.Active);
result.ShouldNotBeNull();
result.Username.ShouldBe(username);
result.Status.ShouldBe(UserStatus.Active);
@@ -52,10 +52,10 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"dup-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "test1", UserStatus.Active);
+ await client.CreateUserAsync(username, "test1", UserStatus.Active);
await Should.ThrowAsync<IggyInvalidStatusCodeException>(
- client.CreateUser(username, "test1", UserStatus.Active));
+ client.CreateUserAsync(username, "test1", UserStatus.Active));
}
[Test]
@@ -65,9 +65,9 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"get-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "test1", UserStatus.Active);
+ await client.CreateUserAsync(username, "test1", UserStatus.Active);
- var response = await client.GetUser(Identifier.String(username));
+ var response = await client.GetUserAsync(Identifier.String(username));
response.ShouldNotBeNull();
response.Id.ShouldBeGreaterThanOrEqualTo(0u);
@@ -84,9 +84,9 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"lst-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "test1", UserStatus.Active);
+ await client.CreateUserAsync(username, "test1", UserStatus.Active);
- IReadOnlyList<UserResponse> response = await client.GetUsers();
+ IReadOnlyList<UserResponse> response = await client.GetUsersAsync();
response.ShouldNotBeNull();
response.ShouldNotBeEmpty();
@@ -103,11 +103,11 @@ public class UsersTests
var username = $"upd-{Guid.NewGuid():N}"[..20];
var newUsername = $"new-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "test1", UserStatus.Active);
+ await client.CreateUserAsync(username, "test1", UserStatus.Active);
- await
Should.NotThrowAsync(client.UpdateUser(Identifier.String(username),
newUsername, UserStatus.Active));
+ await
Should.NotThrowAsync(client.UpdateUserAsync(Identifier.String(username),
newUsername, UserStatus.Active));
- var user = await client.GetUser(Identifier.String(newUsername));
+ var user = await client.GetUserAsync(Identifier.String(newUsername));
user.ShouldNotBeNull();
user.Id.ShouldBeGreaterThanOrEqualTo(0u);
@@ -124,12 +124,12 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"perm-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "test1", UserStatus.Active);
+ await client.CreateUserAsync(username, "test1", UserStatus.Active);
var permissions = CreatePermissions();
- await
Should.NotThrowAsync(client.UpdatePermissions(Identifier.String(username),
permissions));
+ await
Should.NotThrowAsync(client.UpdatePermissionsAsync(Identifier.String(username),
permissions));
- var user = await client.GetUser(Identifier.String(username));
+ var user = await client.GetUserAsync(Identifier.String(username));
user.ShouldNotBeNull();
user.Permissions.ShouldNotBeNull();
@@ -167,13 +167,13 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"chpw-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "old_password", UserStatus.Active);
+ await client.CreateUserAsync(username, "old_password",
UserStatus.Active);
- await
Should.NotThrowAsync(client.ChangePassword(Identifier.String(username),
"old_password", "new_password"));
+ await
Should.NotThrowAsync(client.ChangePasswordAsync(Identifier.String(username),
"old_password", "new_password"));
// Verify password was actually changed by logging in with the new
credentials
var loginClient = await Fixture.CreateClient(protocol);
- var loginResponse = await loginClient.LoginUser(username,
"new_password");
+ var loginResponse = await loginClient.LoginUserAsync(username,
"new_password");
loginResponse.ShouldNotBeNull();
loginResponse.UserId.ShouldBeGreaterThan(0);
}
@@ -185,10 +185,10 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"chpwf-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "correct_password",
UserStatus.Active);
+ await client.CreateUserAsync(username, "correct_password",
UserStatus.Active);
await Should.ThrowAsync<IggyInvalidStatusCodeException>(
- client.ChangePassword(Identifier.String(username),
"wrong_password", "new_password"));
+ client.ChangePasswordAsync(Identifier.String(username),
"wrong_password", "new_password"));
}
[Test]
@@ -198,10 +198,10 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"login-{Guid.NewGuid():N}"[..20];
- await client.CreateUser(username, "login_password", UserStatus.Active);
+ await client.CreateUserAsync(username, "login_password",
UserStatus.Active);
var loginClient = await Fixture.CreateClient(protocol);
- var response = await loginClient.LoginUser(username, "login_password");
+ var response = await loginClient.LoginUserAsync(username,
"login_password");
response.ShouldNotBeNull();
response.UserId.ShouldBeGreaterThan(0);
@@ -223,10 +223,10 @@ public class UsersTests
var client = await Fixture.CreateAuthenticatedClient(protocol);
var username = $"del-{Guid.NewGuid():N}"[..20];
- var userToRemove = await client.CreateUser(username, "test123",
UserStatus.Active);
+ var userToRemove = await client.CreateUserAsync(username, "test123",
UserStatus.Active);
userToRemove.ShouldNotBeNull();
- await
Should.NotThrowAsync(client.DeleteUser(Identifier.String(userToRemove.Username)));
+ await
Should.NotThrowAsync(client.DeleteUserAsync(Identifier.String(userToRemove.Username)));
}
[Test]
@@ -235,7 +235,7 @@ public class UsersTests
{
var client = await Fixture.CreateAuthenticatedClient(protocol);
- await Should.NotThrowAsync(client.LogoutUser());
+ await Should.NotThrowAsync(client.LogoutUserAsync());
}
private static Permissions CreatePermissions()
diff --git a/foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs
b/foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs
index bff1aa2e3..2c5a1b80d 100644
--- a/foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs
+++ b/foreign/csharp/Iggy_SDK/Consumers/IggyConsumer.cs
@@ -76,7 +76,7 @@ public partial class IggyConsumer : IAsyncDisposable
if (_isInitialized)
{
-
_client.UnsubscribeConnectionEvents(OnClientConnectionStateChanged);
+
_client.UnsubscribeConnectionEvents(OnClientConnectionStateChangedAsync);
}
if (!string.IsNullOrEmpty(_consumerGroupName) && _isInitialized)
@@ -98,7 +98,7 @@ public partial class IggyConsumer : IAsyncDisposable
{
try
{
- await _client.LogoutUser();
+ await _client.LogoutUserAsync();
_client.Dispose();
}
catch (Exception e)
@@ -144,12 +144,12 @@ public partial class IggyConsumer : IAsyncDisposable
if (_config.CreateIggyClient)
{
- await _client.LoginUser(_config.Login, _config.Password, ct);
+ await _client.LoginUserAsync(_config.Login, _config.Password,
ct);
}
await InitializeConsumerGroupAsync(ct);
- _client.SubscribeConnectionEvents(OnClientConnectionStateChanged);
+
_client.SubscribeConnectionEvents(OnClientConnectionStateChangedAsync);
_isInitialized = true;
}
@@ -473,7 +473,7 @@ public partial class IggyConsumer : IAsyncDisposable
/// Handles connection state changes from the client.
/// </summary>
/// <param name="e">Event object</param>
- private async Task
OnClientConnectionStateChanged(ConnectionStateChangedEventArgs e)
+ private async Task
OnClientConnectionStateChangedAsync(ConnectionStateChangedEventArgs e)
{
LogConnectionStateChanged(e.PreviousState, e.CurrentState);
diff --git a/foreign/csharp/Iggy_SDK/Contracts/Auth/GlobalPermissions.cs
b/foreign/csharp/Iggy_SDK/Contracts/Auth/GlobalPermissions.cs
index edbff4274..418be5c15 100644
--- a/foreign/csharp/Iggy_SDK/Contracts/Auth/GlobalPermissions.cs
+++ b/foreign/csharp/Iggy_SDK/Contracts/Auth/GlobalPermissions.cs
@@ -51,19 +51,19 @@ public sealed class GlobalPermissions
/// <para>Additionally, allowed methods:</para>
/// <list type="bullet">
/// <item>
- /// <see cref="Apache.Iggy.IggyClient.IIggyUsers.CreateUser" />
+ /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.CreateUserAsync" />
/// </item>
/// <item>
- /// <see cref="Apache.Iggy.IggyClient.IIggyUsers.DeleteUser" />
+ /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.DeleteUserAsync" />
/// </item>
/// <item>
- /// <see cref="Apache.Iggy.IggyClient.IIggyUsers.UpdateUser" />
+ /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.UpdateUserAsync" />
/// </item>
/// <item>
- /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.UpdatePermissions" />
+ /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.UpdatePermissionsAsync" />
/// </item>
/// <item>
- /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.ChangePassword" />
+ /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.ChangePasswordAsync" />
/// </item>
/// </list>
/// </summary>
@@ -74,10 +74,10 @@ public sealed class GlobalPermissions
/// <para>Allowed methods:</para>
/// <list type="bullet">
/// <item>
- /// <see cref="Apache.Iggy.IggyClient.IIggyUsers.GetUser" />
+ /// <see cref="Apache.Iggy.IggyClient.IIggyUsers.GetUserAsync"
/>
/// </item>
/// <item>
- /// <see cref="Apache.Iggy.IggyClient.IIggyUsers.GetUsers" />
+ /// <see
cref="Apache.Iggy.IggyClient.IIggyUsers.GetUsersAsync" />
/// </item>
/// </list>
/// </summary>
diff --git a/foreign/csharp/Iggy_SDK/IggyClient/IIggyPersonalAccessToken.cs
b/foreign/csharp/Iggy_SDK/IggyClient/IIggyPersonalAccessToken.cs
index 661c294d9..3e810b4bd 100644
--- a/foreign/csharp/Iggy_SDK/IggyClient/IIggyPersonalAccessToken.cs
+++ b/foreign/csharp/Iggy_SDK/IggyClient/IIggyPersonalAccessToken.cs
@@ -65,5 +65,5 @@ public interface IIggyPersonalAccessToken
/// A task that represents the asynchronous operation and returns
authentication response with session
/// information, or null if login failed.
/// </returns>
- Task<AuthResponse?> LoginWithPersonalAccessToken(string token,
CancellationToken ct = default);
+ Task<AuthResponse?> LoginWithPersonalAccessTokenAsync(string token,
CancellationToken ct = default);
}
diff --git a/foreign/csharp/Iggy_SDK/IggyClient/IIggyUsers.cs
b/foreign/csharp/Iggy_SDK/IggyClient/IIggyUsers.cs
index a1fd322ce..6369ef37c 100644
--- a/foreign/csharp/Iggy_SDK/IggyClient/IIggyUsers.cs
+++ b/foreign/csharp/Iggy_SDK/IggyClient/IIggyUsers.cs
@@ -32,14 +32,14 @@ public interface IIggyUsers
/// <param name="userId">The identifier of the user to retrieve (numeric
ID or username).</param>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task that represents the asynchronous operation and returns
the user information, or null if not found.</returns>
- Task<UserResponse?> GetUser(Identifier userId, CancellationToken token =
default);
+ Task<UserResponse?> GetUserAsync(Identifier userId, CancellationToken
token = default);
/// <summary>
/// Retrieves information about all users in the system.
/// </summary>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task that represents the asynchronous operation and returns
a read-only collection of user information.</returns>
- Task<IReadOnlyList<UserResponse>> GetUsers(CancellationToken token =
default);
+ Task<IReadOnlyList<UserResponse>> GetUsersAsync(CancellationToken token =
default);
/// <summary>
/// Creates a new user with the specified credentials and permissions.
@@ -53,7 +53,7 @@ public interface IIggyUsers
/// A task that represents the asynchronous operation and returns the
created user information, or null if
/// creation failed.
/// </returns>
- Task<UserResponse?> CreateUser(string userName, string password,
UserStatus status, Permissions? permissions = null,
+ Task<UserResponse?> CreateUserAsync(string userName, string password,
UserStatus status, Permissions? permissions = null,
CancellationToken token = default);
/// <summary>
@@ -62,7 +62,7 @@ public interface IIggyUsers
/// <param name="userId">The identifier of the user to delete (numeric ID
or username).</param>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task representing the asynchronous operation.</returns>
- Task DeleteUser(Identifier userId, CancellationToken token = default);
+ Task DeleteUserAsync(Identifier userId, CancellationToken token = default);
/// <summary>
/// Updates user properties such as username and status.
@@ -72,7 +72,7 @@ public interface IIggyUsers
/// <param name="status">The new status (optional).</param>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task representing the asynchronous operation.</returns>
- Task UpdateUser(Identifier userId, string? userName = null, UserStatus?
status = null,
+ Task UpdateUserAsync(Identifier userId, string? userName = null,
UserStatus? status = null,
CancellationToken token = default);
/// <summary>
@@ -82,7 +82,7 @@ public interface IIggyUsers
/// <param name="permissions">The new permissions to assign (null will
remove all permissions).</param>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task representing the asynchronous operation.</returns>
- Task UpdatePermissions(Identifier userId, Permissions? permissions = null,
CancellationToken token = default);
+ Task UpdatePermissionsAsync(Identifier userId, Permissions? permissions =
null, CancellationToken token = default);
/// <summary>
/// Changes the password for a user.
@@ -92,7 +92,7 @@ public interface IIggyUsers
/// <param name="newPassword">The new password for the user.</param>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task representing the asynchronous operation.</returns>
- Task ChangePassword(Identifier userId, string currentPassword, string
newPassword,
+ Task ChangePasswordAsync(Identifier userId, string currentPassword, string
newPassword,
CancellationToken token = default);
/// <summary>
@@ -108,12 +108,12 @@ public interface IIggyUsers
/// A task that represents the asynchronous operation and returns
authentication response with session
/// information, or null if login failed.
/// </returns>
- Task<AuthResponse?> LoginUser(string userName, string password,
CancellationToken token = default);
+ Task<AuthResponse?> LoginUserAsync(string userName, string password,
CancellationToken token = default);
/// <summary>
/// Logs out the current user, invalidating the current session.
/// </summary>
/// <param name="token">The cancellation token to cancel the
operation.</param>
/// <returns>A task representing the asynchronous operation.</returns>
- Task LogoutUser(CancellationToken token = default);
+ Task LogoutUserAsync(CancellationToken token = default);
}
diff --git
a/foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs
b/foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs
index 0f1a9191b..fac18e1de 100644
--- a/foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs
+++ b/foreign/csharp/Iggy_SDK/IggyClient/Implementations/HttpMessageStream.cs
@@ -592,7 +592,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<UserResponse?> GetUser(Identifier userId,
CancellationToken token = default)
+ public async Task<UserResponse?> GetUserAsync(Identifier userId,
CancellationToken token = default)
{
//TODO - this doesn't work prob needs a custom json serializer
var response = await _httpClient.GetAsync($"/users/{userId}", token);
@@ -606,7 +606,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<IReadOnlyList<UserResponse>> GetUsers(CancellationToken
token = default)
+ public async Task<IReadOnlyList<UserResponse>>
GetUsersAsync(CancellationToken token = default)
{
var response = await _httpClient.GetAsync("/users", token);
if (response.IsSuccessStatusCode)
@@ -620,7 +620,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<UserResponse?> CreateUser(string userName, string
password, UserStatus status,
+ public async Task<UserResponse?> CreateUserAsync(string userName, string
password, UserStatus status,
Permissions? permissions = null, CancellationToken token = default)
{
var json = JsonSerializer.Serialize(new CreateUserRequest(userName,
password, status, permissions),
@@ -638,7 +638,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task DeleteUser(Identifier userId, CancellationToken token =
default)
+ public async Task DeleteUserAsync(Identifier userId, CancellationToken
token = default)
{
var response = await _httpClient.DeleteAsync($"/users/{userId}",
token);
if (!response.IsSuccessStatusCode)
@@ -648,7 +648,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task UpdateUser(Identifier userId, string? userName = null,
UserStatus? status = null,
+ public async Task UpdateUserAsync(Identifier userId, string? userName =
null, UserStatus? status = null,
CancellationToken token = default)
{
var json = JsonSerializer.Serialize(new UpdateUserRequest(userName,
status), _jsonSerializerOptions);
@@ -661,7 +661,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task UpdatePermissions(Identifier userId, Permissions?
permissions = null,
+ public async Task UpdatePermissionsAsync(Identifier userId, Permissions?
permissions = null,
CancellationToken token = default)
{
var json = JsonSerializer.Serialize(new
UpdateUserPermissionsRequest(permissions), _jsonSerializerOptions);
@@ -674,7 +674,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task ChangePassword(Identifier userId, string
currentPassword, string newPassword,
+ public async Task ChangePasswordAsync(Identifier userId, string
currentPassword, string newPassword,
CancellationToken token = default)
{
var json = JsonSerializer.Serialize(new
ChangePasswordRequest(currentPassword, newPassword),
@@ -688,7 +688,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<AuthResponse?> LoginUser(string userName, string
password, CancellationToken token = default)
+ public async Task<AuthResponse?> LoginUserAsync(string userName, string
password, CancellationToken token = default)
{
// TODO: Add binary protocol version
var json = JsonSerializer.Serialize(new LoginUserRequest(userName,
password, SdkVersion.Value, Context),
@@ -719,7 +719,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task LogoutUser(CancellationToken token = default)
+ public async Task LogoutUserAsync(CancellationToken token = default)
{
var response = await _httpClient.DeleteAsync("users/logout", token);
if (!response.IsSuccessStatusCode)
@@ -774,7 +774,7 @@ public class HttpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<AuthResponse?> LoginWithPersonalAccessToken(string
token, CancellationToken ct = default)
+ public async Task<AuthResponse?> LoginWithPersonalAccessTokenAsync(string
token, CancellationToken ct = default)
{
var json = JsonSerializer.Serialize(new
LoginWithPersonalAccessTokenRequest(token), _jsonSerializerOptions);
diff --git
a/foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs
b/foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs
index 88cfe0472..ed8d42445 100644
--- a/foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs
+++ b/foreign/csharp/Iggy_SDK/IggyClient/Implementations/TcpMessageStream.cs
@@ -626,7 +626,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<UserResponse?> GetUser(Identifier userId,
CancellationToken token = default)
+ public async Task<UserResponse?> GetUserAsync(Identifier userId,
CancellationToken token = default)
{
var message = TcpContracts.GetUser(userId);
var payload = new byte[4 + BufferSizes.INITIAL_BYTES_LENGTH +
message.Length];
@@ -643,7 +643,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<IReadOnlyList<UserResponse>> GetUsers(CancellationToken
token = default)
+ public async Task<IReadOnlyList<UserResponse>>
GetUsersAsync(CancellationToken token = default)
{
var message = Array.Empty<byte>();
var payload = new byte[4 + BufferSizes.INITIAL_BYTES_LENGTH +
message.Length];
@@ -660,7 +660,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<UserResponse?> CreateUser(string userName, string
password, UserStatus status,
+ public async Task<UserResponse?> CreateUserAsync(string userName, string
password, UserStatus status,
Permissions? permissions = null, CancellationToken token = default)
{
var message = TcpContracts.CreateUser(userName, password, status,
permissions);
@@ -678,7 +678,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task DeleteUser(Identifier userId, CancellationToken token =
default)
+ public async Task DeleteUserAsync(Identifier userId, CancellationToken
token = default)
{
var message = TcpContracts.DeleteUser(userId);
var payload = new byte[4 + BufferSizes.INITIAL_BYTES_LENGTH +
message.Length];
@@ -688,7 +688,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task UpdateUser(Identifier userId, string? userName = null,
UserStatus? status = null,
+ public async Task UpdateUserAsync(Identifier userId, string? userName =
null, UserStatus? status = null,
CancellationToken token = default)
{
var message = TcpContracts.UpdateUser(userId, userName, status);
@@ -699,7 +699,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task UpdatePermissions(Identifier userId, Permissions?
permissions = null,
+ public async Task UpdatePermissionsAsync(Identifier userId, Permissions?
permissions = null,
CancellationToken token = default)
{
var message = TcpContracts.UpdatePermissions(userId, permissions);
@@ -710,7 +710,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task ChangePassword(Identifier userId, string
currentPassword, string newPassword,
+ public async Task ChangePasswordAsync(Identifier userId, string
currentPassword, string newPassword,
CancellationToken token = default)
{
var message = TcpContracts.ChangePassword(userId, currentPassword,
newPassword);
@@ -721,7 +721,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<AuthResponse?> LoginUser(string userName, string
password, CancellationToken token = default)
+ public async Task<AuthResponse?> LoginUserAsync(string userName, string
password, CancellationToken token = default)
{
if (_state == ConnectionState.Disconnected)
{
@@ -747,7 +747,7 @@ public sealed class TcpMessageStream : IIggyClient
if (await RedirectAsync(token))
{
await ConnectAsync(token);
- return await LoginUser(userName, password, token);
+ return await LoginUserAsync(userName, password, token);
}
var authResponse = new AuthResponse(userId, null);
@@ -755,7 +755,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task LogoutUser(CancellationToken token = default)
+ public async Task LogoutUserAsync(CancellationToken token = default)
{
var message = Array.Empty<byte>();
var payload = new byte[4 + BufferSizes.INITIAL_BYTES_LENGTH +
message.Length];
@@ -811,7 +811,7 @@ public sealed class TcpMessageStream : IIggyClient
}
/// <inheritdoc />
- public async Task<AuthResponse?> LoginWithPersonalAccessToken(string
token, CancellationToken ct = default)
+ public async Task<AuthResponse?> LoginWithPersonalAccessTokenAsync(string
token, CancellationToken ct = default)
{
var message = TcpContracts.LoginWithPersonalAccessToken(token);
var payload = new byte[4 + BufferSizes.INITIAL_BYTES_LENGTH +
message.Length];
@@ -832,7 +832,7 @@ public sealed class TcpMessageStream : IIggyClient
if (await RedirectAsync(ct))
{
await ConnectAsync(ct);
- return await LoginWithPersonalAccessToken(token, ct);
+ return await LoginWithPersonalAccessTokenAsync(token, ct);
}
return new AuthResponse(userId, null);
@@ -883,7 +883,7 @@ public sealed class TcpMessageStream : IIggyClient
{
_logger.LogInformation("Auto login enabled. Trying to
login with credentials: {Username}",
_configuration.AutoLoginSettings.Username);
- await LoginUser(_configuration.AutoLoginSettings.Username,
+ await
LoginUserAsync(_configuration.AutoLoginSettings.Username,
_configuration.AutoLoginSettings.Password, token);
}
diff --git a/foreign/csharp/Iggy_SDK/Iggy_SDK.csproj
b/foreign/csharp/Iggy_SDK/Iggy_SDK.csproj
index 5f58609e8..fb31d48de 100644
--- a/foreign/csharp/Iggy_SDK/Iggy_SDK.csproj
+++ b/foreign/csharp/Iggy_SDK/Iggy_SDK.csproj
@@ -7,7 +7,7 @@
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
<AssemblyName>Apache.Iggy</AssemblyName>
<RootNamespace>Apache.Iggy</RootNamespace>
- <Version>0.7.1-edge.2</Version>
+ <Version>0.7.1-edge.3</Version>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
diff --git a/foreign/csharp/Iggy_SDK/Publishers/IggyPublisher.cs
b/foreign/csharp/Iggy_SDK/Publishers/IggyPublisher.cs
index 9134224da..1b95c9da8 100644
--- a/foreign/csharp/Iggy_SDK/Publishers/IggyPublisher.cs
+++ b/foreign/csharp/Iggy_SDK/Publishers/IggyPublisher.cs
@@ -91,7 +91,7 @@ public partial class IggyPublisher : IAsyncDisposable
{
try
{
- await _client.LogoutUser();
+ await _client.LogoutUserAsync();
_client.Dispose();
}
catch (Exception e)
@@ -160,12 +160,12 @@ public partial class IggyPublisher : IAsyncDisposable
LogInitializingPublisher(_config.StreamId, _config.TopicId);
if (_config.CreateIggyClient)
{
- await _client.LoginUser(_config.Login, _config.Password, ct);
+ await _client.LoginUserAsync(_config.Login, _config.Password, ct);
LogUserLoggedIn(_config.Login);
}
- await CreateStreamIfNeeded(ct);
- await CreateTopicIfNeeded(ct);
+ await CreateStreamIfNeededAsync(ct);
+ await CreateTopicIfNeededAsync(ct);
if (_config.EnableBackgroundSending)
{
@@ -182,7 +182,7 @@ public partial class IggyPublisher : IAsyncDisposable
/// </summary>
/// <param name="ct">Cancellation token to cancel the operation.</param>
/// <exception cref="StreamNotFoundException">Thrown when the stream
doesn't exist and auto-creation is disabled.</exception>
- private async Task CreateStreamIfNeeded(CancellationToken ct)
+ private async Task CreateStreamIfNeededAsync(CancellationToken ct)
{
if (await _client.GetStreamByIdAsync(_config.StreamId, ct) != null)
{
@@ -215,7 +215,7 @@ public partial class IggyPublisher : IAsyncDisposable
/// </summary>
/// <param name="ct">Cancellation token to cancel the operation.</param>
/// <exception cref="TopicNotFoundException">Thrown when the topic doesn't
exist and auto-creation is disabled.</exception>
- private async Task CreateTopicIfNeeded(CancellationToken ct)
+ private async Task CreateTopicIfNeededAsync(CancellationToken ct)
{
if (await _client.GetTopicByIdAsync(_config.StreamId, _config.TopicId,
ct) != null)
{
@@ -255,7 +255,7 @@ public partial class IggyPublisher : IAsyncDisposable
/// <param name="messages">The messages to send.</param>
/// <param name="ct">Cancellation token to cancel the send
operation.</param>
/// <exception cref="PublisherNotInitializedException">Thrown when
attempting to send before initialization.</exception>
- public async Task SendMessages(IList<Message> messages, CancellationToken
ct = default)
+ public async Task SendMessagesAsync(IList<Message> messages,
CancellationToken ct = default)
{
if (!_isInitialized)
{
@@ -290,7 +290,7 @@ public partial class IggyPublisher : IAsyncDisposable
/// Only applicable when background sending is enabled. Returns
immediately otherwise.
/// </summary>
/// <param name="ct">Cancellation token to cancel the wait
operation.</param>
- public async Task WaitUntilAllSends(CancellationToken ct = default)
+ public async Task WaitUntilAllSendsAsync(CancellationToken ct = default)
{
if (!_config.EnableBackgroundSending || _backgroundProcessor == null)
{
diff --git a/foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs
b/foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs
index 7eeb59400..621b03b99 100644
--- a/foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs
+++ b/foreign/csharp/Iggy_SDK/Publishers/IggyPublisherOfT.cs
@@ -56,7 +56,7 @@ public class IggyPublisher<T> : IggyPublisher
Dictionary<HeaderKey, HeaderValue>? userHeaders = null,
CancellationToken ct = default)
{
var message = CreateMessage(data, messageId, userHeaders);
- await SendMessages([message], ct);
+ await SendMessagesAsync([message], ct);
}
/// <summary>
@@ -67,7 +67,7 @@ public class IggyPublisher<T> : IggyPublisher
public async Task SendAsync(IEnumerable<T> data, CancellationToken ct =
default)
{
var messages = data.Select(item => CreateMessage(item, null,
null)).ToList();
- await SendMessages(messages, ct);
+ await SendMessagesAsync(messages, ct);
}
/// <summary>
@@ -79,7 +79,7 @@ public class IggyPublisher<T> : IggyPublisher
CancellationToken ct = default)
{
var messages = items.Select(item => CreateMessage(item.data,
item.messageId, item.userHeaders)).ToList();
- await SendMessages(messages, ct);
+ await SendMessagesAsync(messages, ct);
}
/// <summary>
diff --git a/foreign/csharp/README.md b/foreign/csharp/README.md
index eed4f5297..b66d66e16 100644
--- a/foreign/csharp/README.md
+++ b/foreign/csharp/README.md
@@ -113,7 +113,7 @@ await client.ConnectAsync();
Begin by using the root account (note: the root account cannot be removed or
updated):
```c#
-var response = await client.LoginUser("iggy", "iggy");
+var response = await client.LoginUserAsync("iggy", "iggy");
```
### Creating Users
@@ -138,10 +138,10 @@ var permissions = new Permissions
}
};
-await client.CreateUser("test_user", "secure_password", UserStatus.Active,
permissions);
+await client.CreateUserAsync("test_user", "secure_password",
UserStatus.Active, permissions);
// Login with the new user
-var loginResponse = await client.LoginUser("test_user", "secure_password");
+var loginResponse = await client.LoginUserAsync("test_user",
"secure_password");
```
### Personal Access Tokens
@@ -153,7 +153,7 @@ Create and use Personal Access Tokens (PAT) for
programmatic access:
var patResponse = await client.CreatePersonalAccessTokenAsync("api-token",
3600);
// Login with PAT
-await client.LoginWithPersonalAccessToken(patResponse.Token);
+await client.LoginWithPersonalAccessTokenAsync(patResponse.Token);
```
## Streams and Topics