Class ModelSubscription
- Namespace
- DuetControlServer.IPC.Processors
- Assembly
- DuetControlServer.dll
Subscription processor that notifies clients about object model changes. There is no point in deserializing the object model here so only the JSON representation is kept here.
public sealed class ModelSubscription : IProcessor
- Inheritance
-
ModelSubscription
- Implements
- Inherited Members
Constructors
ModelSubscription(Connection, ClientInitMessage, Filter, ObjectModel, Observer, ILogger<ModelSubscription>, IOptions<Settings>)
Constructor of the subscription processor
public ModelSubscription(Connection conn, ClientInitMessage initMessage, Filter filter, ObjectModel model, Observer observer, ILogger<ModelSubscription> logger, IOptions<Settings> settings)
Parameters
connConnectionConnection instance
initMessageClientInitMessageInitialization message
filterFilterFilter to access the machine model
modelObjectModelObject model
observerObserverObserver to receive property change notifications
loggerILogger<ModelSubscription>Logger instance
settingsIOptions<Settings>Settings
Properties
Connection
Connection to the IPC client served by this processor
public Connection Connection { get; }
Property Value
HasClientsWaitingForMessages
Check if there are any clients waiting for generic messages
public static bool HasClientsWaitingForMessages { get; }
Property Value
SupportedCommands
List of supported commands in this mode
public static Type[] SupportedCommands { get; }
Property Value
- Type[]
Methods
GetPathNode(Dictionary<string, object?>, object[])
Get the dictionary or list object using a path node to record properties
public static object? GetPathNode(Dictionary<string, object?> root, object[] path)
Parameters
rootDictionary<string, object>Root dictionary
pathobject[]Path node
Returns
- object
Item at the given path
ProcessAsync(CancellationToken)
Task that keeps pushing model updates to the client
public Task ProcessAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token to cancel the worker
Returns
- Task
Task that represents the lifecycle of a connection
RecordMessage(MessageTypeFlags, Message)
Record a new message based on the message flags
public static void RecordMessage(MessageTypeFlags flags, Message message)
Parameters
flagsMessageTypeFlagsMessage flags
messageMessage