Class ModelObserver
Class used to observe the machine model
Inherited Members
Namespace: DuetWebServer.Services
Assembly: DuetWebServer.dll
Syntax
public sealed class ModelObserver : BackgroundService, IHostedService, IDisposable
Constructors
ModelObserver(IConfiguration, ILogger<ModelObserver>, IModelProvider, ISessionStorage)
Constructor of this service class
Declaration
public ModelObserver(IConfiguration configuration, ILogger<ModelObserver> logger, IModelProvider modelProvider, ISessionStorage sessionStorage)
Parameters
Type | Name | Description |
---|---|---|
IConfiguration | configuration | App configuration |
ILogger<ModelObserver> | logger | Logger instance |
IModelProvider | modelProvider | Model provider singleton |
ISessionStorage | sessionStorage |
Fields
CorsPolicy
Configured CORS policy for cross-origin requests
Declaration
public static readonly CorsPolicy CorsPolicy
Field Value
Type | Description |
---|---|
CorsPolicy |
Methods
CheckWebSocketOrigin(HttpContext)
Check the origin of an incoming WebSocket request and set the status on error
Declaration
public static bool CheckWebSocketOrigin(HttpContext httpContext)
Parameters
Type | Name | Description |
---|---|---|
HttpContext | httpContext | HTTP context to check |
Returns
Type | Description |
---|---|
bool | True if the origin is allowed |
ExecuteAsync(CancellationToken)
Synchronize all registered endpoints and user sessions
Declaration
protected override Task ExecuteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |