Provides base implementation of IAsyncDisposableExtended with disposal behavior intended for this interface.
More...
|
async ValueTask | DisposeAsync () |
|
|
| AsyncDisposableExtendedBase (ILogger logger) |
| Base constructor for device api. More...
|
|
abstract ValueTask | DisposeAsyncCore () |
| Derived type disposal logic. More...
|
|
void | UpdateLoggerContext () |
| Unfortunately Serilog ForContext method does not store provided object as property value, calling its ToString method immediately instead. In some cases, we want to use information like device name/id as log context but it is only available when derived type is fully constructed and maybe some other initialization took place. For such cases, derived type can use this method to update Logger context value.
|
|
|
ILogger | Logger [get] |
| Logger associated with this instance. This way extension methods can use logging without requiring it as parameter. More...
|
|
Boolean | IsDisposed [get] |
| Determines whether the object is being disposed or already disposed and no longer functional. More...
|
|
virtual IAsyncDisposableExtended | Owner [get] |
| Type and ToString values of this object will appear when logging begin/end of DisposeAsync. This object will also be used as Disposed sender, essentially allowing seamlessly using AsyncDisposableExtendedBase logic even when directly inheriting from it is not possible. Usually it simply returns "this" value, but AsyncDisposableExtendedImpl overrides it to return its owner instance for the aforementioned reason.
|
|
Boolean | IsDisposed [get] |
| Determines whether the object is being disposed or already disposed and no longer functional. More...
|
|
ILogger | Logger [get] |
| Logger associated with this instance. This way extension methods can use logging without requiring it as parameter. More...
|
|
|
AsyncTypedEventHandler< IAsyncDisposableExtended >? | Disposed |
|
AsyncTypedEventHandler< IAsyncDisposableExtended > | Disposed |
| Occurs when object is disposed. It should be invoked at the end of IAsyncDisposable.DisposeAsync implementation in a Fire-and-Forget fashion (non-blocking).
|
|
Provides base implementation of IAsyncDisposableExtended with disposal behavior intended for this interface.
◆ AsyncDisposableExtendedBase()
AsyncDisposableExtendedBase.AsyncDisposableExtendedBase |
( |
ILogger |
logger | ) |
|
|
protected |
Base constructor for device api.
Derived types should implement Object.ToString method to contain information for log context (like device name and ID) and call UpdateLoggerContext whenever this information becomes available. If Object.ToString provides constant value (like nameof(DerivedType)), call to UpdateLoggerContext is not needed.
◆ DisposeAsyncCore()
abstract ValueTask AsyncDisposableExtendedBase.DisposeAsyncCore |
( |
| ) |
|
|
protectedpure virtual |
Derived type disposal logic.
Implemented in AsyncDisposableExtendedImpl, ComponentBasedDeviceApiBase, LegacyMftMessagesTransport, LegacyMftApi, LegacyMftCommandRunner, MftApi, MftCommandRunner, MftMessagesTransport, ModbusCommandRunner, ModbusListener, and RD300TurntableApi.
◆ Logger
ILogger AsyncDisposableExtendedBase.Logger |
|
get |
Logger associated with this instance. This way extension methods can use logging without requiring it as parameter.
Implements IAsyncDisposableExtended.
◆ IsDisposed
Boolean AsyncDisposableExtendedBase.IsDisposed |
|
get |
Determines whether the object is being disposed or already disposed and no longer functional.
Implements IAsyncDisposableExtended.