Skip to content

Commit

Permalink
Rename EachClientAsync to ForEachClientAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Joy-less committed Mar 29, 2024
1 parent b12c16a commit 11220e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TCPMaid/Maids/ServerMaid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ public void Stop() {
/// </summary>
public async Task BroadcastAsync(Message Message, Channel? Exclude = null, Predicate<Channel>? ExcludeWhere = null) {
// Send message to each client
await EachClientAsync(async Client => await Client.SendAsync(Message), Exclude, ExcludeWhere);
await ForEachClientAsync(async Client => await Client.SendAsync(Message), Exclude, ExcludeWhere);
}
/// <summary>
/// Disconnects every connected client.
/// </summary>
public async Task DisconnectAllAsync(string Reason = DisconnectReason.None, Channel? Exclude = null, Predicate<Channel>? ExcludeWhere = null) {
// Disconnect each client
await EachClientAsync(async Client => await Client.DisconnectAsync(Reason), Exclude, ExcludeWhere);
await ForEachClientAsync(async Client => await Client.DisconnectAsync(Reason), Exclude, ExcludeWhere);
}
/// <summary>
/// Runs an asynchronous action for every connected client.
/// </summary>
public async Task EachClientAsync(Func<Channel, Task> Action, Channel? Exclude, Predicate<Channel>? ExcludeWhere) {
public async Task ForEachClientAsync(Func<Channel, Task> Action, Channel? Exclude, Predicate<Channel>? ExcludeWhere) {
// Start action for each client
List<Task> Tasks = [];
foreach (Channel Client in Clients) {
Expand Down

0 comments on commit 11220e7

Please sign in to comment.