Skip to content

UdsClientExtensions Class

Asynchronous disposal for IUdsClient.

public static class UdsClientExtensions

Inheritance Object → UdsClientExtensions

Remarks

IUdsClient itself stays IDisposable: adding IAsyncDisposable to a published interface would break everyone who implements it. The clients this library creates implement it, and DisposeAsync(this IUdsClient) reaches it without a cast.

Methods

UdsClientExtensions.DisposeAsync(this IUdsClient) Method

Disposes client without holding a thread while it waits for the TesterPresent keep-alive loop and for an in-flight request to let go of the request lock, which IDisposable.Dispose does for up to its timeouts. Both are bounded: a request or loop that needs the channel's actor while a callback of the channel holds it (a caller disposing from BackgroundExceptionOccurred of the channel, say) ends when the cancellation reaches it, not by being waited for for ever. A second call while the first is running returns when the disposal has finished. A client that is not one of this library's is disposed on the thread pool.

public static System.Threading.Tasks.ValueTask DisposeAsync(this CanKit.Pro.Uds.IUdsClient client);

Parameters

client IUdsClient

The client to dispose.

Returns

ValueTask