Class ResourcesMonitor<TModel, TContext, TQuery>
Class to monitor a resource collection by GET queries
Inherited Members
Namespace: PayrollEngine.Client.Exchange
Assembly: PayrollEngine.Client.Core.dll
Syntax
public class ResourcesMonitor<TModel, TContext, TQuery> where TModel : class where TContext : IServiceContext where TQuery : Query, new()
Type Parameters
| Name | Description |
|---|---|
| TModel | |
| TContext | |
| TQuery |
Constructors
ResourcesMonitor(IReadService<TModel, TContext, TQuery>, TContext, Action<ICollection<TModel>>)
Default constructor
Declaration
public ResourcesMonitor(IReadService<TModel, TContext, TQuery> service, TContext context, Action<ICollection<TModel>> changeHandler)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadService<TModel, TContext, TQuery> | service | The query service |
| TContext | context | The execution context |
| Action<ICollection<TModel>> | changeHandler | The monitoring handler |
Properties
ChangeHandler
The monitoring handler
Declaration
public Action<ICollection<TModel>> ChangeHandler { get; }
Property Value
| Type | Description |
|---|---|
| Action<ICollection<TModel>> |
Context
The execution context
Declaration
public TContext Context { get; set; }
Property Value
| Type | Description |
|---|---|
| TContext |
Interval
The query interval
Declaration
public TimeSpan Interval { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
IsRunning
Monitoring running state
Declaration
public bool IsRunning { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MinInterval
The minimum query interval
Declaration
public static TimeSpan MinInterval { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Service
The query service
Declaration
public IReadService<TModel, TContext, TQuery> Service { get; }
Property Value
| Type | Description |
|---|---|
| IReadService<TModel, TContext, TQuery> |
Methods
StartAsync(CancellationToken)
Start the monitoring async
Declaration
public Task StartAsync(CancellationToken token)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | token |
Returns
| Type | Description |
|---|---|
| Task |