Azure / azure-iot-sdk-csharp

A C# SDK for connecting devices to Microsoft Azure IoT services
Other
468 stars 492 forks source link

[feature request] IAsyncEnumerable in v2 #3156

Closed timtay-microsoft closed 1 year ago

timtay-microsoft commented 1 year ago

Consider utilizing the IAsyncEnumerable interface for the various query-like APIs we have

public virtual async Task<IAsyncEnumerable<T>> CreateAsync<T>(string query, QueryOptions options = default, CancellationToken cancellationToken = default)

rather than declaring custom paging-like APIs such as

public virtual async Task<QueryResponse<T>> CreateAsync<T>(string query, QueryOptions options = default, CancellationToken cancellationToken = default)
timtay-microsoft commented 1 year ago

Note that we already use async interfaces from netstandard 2.1+ by taking a dependency on the library directly: https://github.com/Azure/azure-iot-sdk-csharp/blob/previews/v2/iothub/device/src/Microsoft.Azure.Devices.Client.csproj#L74-L75

timtay-microsoft commented 1 year ago

3165 will address this feature request

timtay-microsoft commented 1 year ago

This feature has been included in our latest preview release here, so I'm closing this thread