Table of Contents

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

string

Capabilities

Gets the plugin's capabilities and features.

PluginCapabilities Capabilities { get; }

Property Value

PluginCapabilities

Description

Gets the description of the plugin.

string Description { get; }

Property Value

string

Health

Gets the plugin's health status.

PluginHealth Health { get; }

Property Value

PluginHealth

Id

Gets the unique identifier for this plugin.

string Id { get; }

Property Value

string

Name

Gets the display name of the plugin.

string Name { get; }

Property Value

string

State

Gets the current state of the plugin.

PluginState State { get; }

Property Value

PluginState

Version

Gets the version of the plugin.

Version Version { get; }

Property Value

Version

Methods

ConfigureServices(IServiceCollection, IConfiguration)

Configures services for dependency injection.

void ConfigureServices(IServiceCollection services, IConfiguration configuration)

Parameters

services IServiceCollection

The service collection to configure.

configuration IConfiguration

The 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

serviceProvider IServiceProvider

The service provider for dependency resolution.

cancellationToken CancellationToken

Cancellation token.

Returns

Task

Task representing the async operation.

OnConfigurationChangedAsync(IConfiguration, CancellationToken)

Handles configuration changes at runtime.

Task OnConfigurationChangedAsync(IConfiguration configuration, CancellationToken cancellationToken = default)

Parameters

configuration IConfiguration

The new configuration.

cancellationToken CancellationToken

Cancellation token.

Returns

Task

Task representing the async operation.

StartAsync(CancellationToken)

Starts the plugin asynchronously.

Task StartAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task

Task representing the async operation.

StopAsync(CancellationToken)

Stops the plugin asynchronously.

Task StopAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancellation 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

EventHandler<PluginErrorEventArgs>

HealthChanged

Occurs when health changed.

event EventHandler<PluginHealthChangedEventArgs>? HealthChanged

Event Type

EventHandler<PluginHealthChangedEventArgs>

StateChanged

Occurs when state changed.

event EventHandler<PluginStateChangedEventArgs>? StateChanged

Event Type

EventHandler<PluginStateChangedEventArgs>