Skip to content

Commit

Permalink
Add async version of IRestChannel.Status
Browse files Browse the repository at this point in the history
Fixes #1263
  • Loading branch information
fdmarc committed Sep 27, 2023
1 parent d7abbde commit 016e049
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/IO.Ably.Shared/Rest/IRestChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ public interface IRestChannel
/// Returns the active status for the channel including the number of publishers, subscribers and presenceMembers etc.
/// </summary>
/// <returns><see cref="ChannelDetails"/>Channel Details.</returns>
Task<ChannelDetails> StatusAsync();

/// <summary>
/// Sync version of <see cref="StatusAsync()"/>.
/// /// Prefer async version where possible.
/// </summary>
/// <returns><see cref="ChannelDetails"/>Channel Details.</returns>
ChannelDetails Status();
}

Expand Down
3 changes: 2 additions & 1 deletion src/IO.Ably.Shared/Rest/RestChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ public PaginatedResult<Message> History(PaginatedRequestParams query)
return AsyncHelper.RunSync(() => HistoryAsync(query));
}

private async Task<ChannelDetails> StatusAsync()
/// <inheritdoc/>
public async Task<ChannelDetails> StatusAsync()
{
AblyRequest request = _ablyRest.CreateGetRequest("/channels/" + Name);
return await _ablyRest.ExecuteRequest<ChannelDetails>(request);
Expand Down

0 comments on commit 016e049

Please sign in to comment.