Interface IBackendPlugin
- Namespace
- DotCompute.Plugins.Interfaces
- Assembly
- DotCompute.Plugins.dll
Base interface for all DotCompute backend plugins.
public interface IBackendPlugin : IDisposable
- Inherited Members
- Extension Methods
Properties
Author
Gets the author of the plugin.
string Author { get; }
Property Value
Capabilities
Gets the plugin's capabilities and features.
PluginCapabilities Capabilities { get; }
Property Value
Description
Gets the description of the plugin.
string Description { get; }
Property Value
Health
Gets the plugin's health status.
PluginHealth Health { get; }
Property Value
Id
Gets the unique identifier for this plugin.
string Id { get; }
Property Value
Name
Gets the display name of the plugin.
string Name { get; }
Property Value
State
Gets the current state of the plugin.
PluginState State { get; }
Property Value
Version
Gets the version of the plugin.
Version Version { get; }
Property Value
Methods
ConfigureServices(IServiceCollection, IConfiguration)
Configures services for dependency injection.
void ConfigureServices(IServiceCollection services, IConfiguration configuration)
Parameters
servicesIServiceCollectionThe service collection to configure.
configurationIConfigurationThe configuration for the plugin.
GetConfigurationSchema()
Gets the plugin's configuration schema.
string GetConfigurationSchema()
Returns
- string
JSON schema for the plugin's configuration.
GetMetrics()
Gets the plugin's performance metrics.
PluginMetrics GetMetrics()
Returns
- PluginMetrics
Current performance metrics.
InitializeAsync(IServiceProvider, CancellationToken)
Initializes the plugin asynchronously.
Task InitializeAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken = default)
Parameters
serviceProviderIServiceProviderThe service provider for dependency resolution.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
Task representing the async operation.
OnConfigurationChangedAsync(IConfiguration, CancellationToken)
Handles configuration changes at runtime.
Task OnConfigurationChangedAsync(IConfiguration configuration, CancellationToken cancellationToken = default)
Parameters
configurationIConfigurationThe new configuration.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
Task representing the async operation.
StartAsync(CancellationToken)
Starts the plugin asynchronously.
Task StartAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
Task representing the async operation.
StopAsync(CancellationToken)
Stops the plugin asynchronously.
Task StopAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
Task representing the async operation.
Validate()
Validates the plugin's configuration and dependencies.
PluginValidationResult Validate()
Returns
- PluginValidationResult
Validation result with any errors or warnings.
Events
ErrorOccurred
Occurs when error occurred.
event EventHandler<PluginErrorEventArgs>? ErrorOccurred
Event Type
HealthChanged
Occurs when health changed.
event EventHandler<PluginHealthChangedEventArgs>? HealthChanged
Event Type
StateChanged
Occurs when state changed.
event EventHandler<PluginStateChangedEventArgs>? StateChanged