Class ModelSubscription
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.
Inherited Members
Namespace: DuetControlServer.IPC.Processors
Assembly: DuetControlServer.dll
Syntax
public sealed class ModelSubscription : Base
Constructors
ModelSubscription(Connection, ClientInitMessage)
Constructor of the subscription processor
Declaration
public ModelSubscription(Connection conn, ClientInitMessage initMessage)
Parameters
Type | Name | Description |
---|---|---|
Connection | conn | Connection instance |
ClientInitMessage | initMessage | Initialization message |
Fields
SupportedCommands
List of supported commands in this mode
Declaration
public static readonly Type[] SupportedCommands
Field Value
Type | Description |
---|---|
Type[] |
Properties
HasClientsWaitingForMessages
Check if there are any clients waiting for generic messages
Declaration
public static bool HasClientsWaitingForMessages { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetPathNode(Dictionary<string, object?>, object[])
Get the dictionary or list object using a path node to record properties
Declaration
public static object? GetPathNode(Dictionary<string, object?> root, object[] path)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<string, object> | root | Root dictionary |
object[] | path | Path node |
Returns
Type | Description |
---|---|
object | Item at the given path |
Process()
Task that keeps pushing model updates to the client
Declaration
public override Task Process()
Returns
Type | Description |
---|---|
Task | Task that represents the lifecycle of a connection |
Overrides
RecordMessage(MessageTypeFlags, Message)
Record a new message based on the message flags
Declaration
public static void RecordMessage(MessageTypeFlags flags, Message message)
Parameters
Type | Name | Description |
---|---|---|
MessageTypeFlags | flags | Message flags |
Message | message |