Name of a specific service to which the response should be targeted to
Source
Name of a specific service this message originates from
Name
Setting on a service (in case of a JSON by using the dot (.) notation)
Value
Value of a setting on a service
NOTE: this value can be either a JSON or a single value
Message types
Get
Get state or non-state value from the service
Description
Command used to fetch the current value of a state or non-state value on a Service. Try to avoid continuous polling, instead subscribe to Update-messages and just listen to changes.
When you are receiving this someone is asking about the state or a non-state value.
Return the value via an Update-command targeted to them
If you don’t have this value, return "Value":"null" in the message
optionally send a log message of type Warning (more on the Log command below).
Set
Request change of state or non-state values on the service
Description
Command used by a Service that attempts to change the state or a non-state value of another service. It is not guaranteed to have any effect and does not include information about the sender. You can set things inside the state struct or on specific exposed values.
When someone sends this message they probably expect you to change your singleton state, part of it, or something else to the new value. If you do that (you are also free to refuse it), remember to send an Update command afterwards(more on Update below).
Reset
Request that service state returns to default
Description
Command used to reset the state of a Service to default.
Template
Topic
{"Type":"Reset","Target":"Service"}
Message
{}
Example
Topic
{"Type":"Reset","Target":"Jakubs-PC-CTS"}
Message
{}
When Receiving
When you are receiving this, there is likely some disconnection of the current context happening.
Reset or return to a "baseline" and/or a generic start state
When setting this default state, remember to send an Update-message to notify listeners
Update
Returned on a Get request and when state or non-state variables change
Description
Used when the state of a Service changes. This command should be sent every time there is a change. Services decide whether they want to listen to these updates or not.
It is also sent as a response to a Get request. In this case the "RespondTo"-field of the Get request is used as the "Target" of the Update message.
When receiving this message, it means a value you had subscribed to has been updated or a value you have asked for has been retrieved.
It’s up to you if you want to do something with this or not, but if you don’t you probably want to unsubscribe in order to not waste network resources.
Identify
Constantly ticking heartbeat to see what services are connected and responsive
Description
Used by the central server to get information about connected Services, if you don’t respond you won't be considered connected (and won’t appear in Store’s ConnectedClients).
When receiving this message you should respond with a Self command to the one asking, or other services won’t be able to find you (more on the Self command below).
Self
Service response to Identify
Description
Sent as an answer to the Identify-request OR directly when coming online to avoid having to wait for the next heartbeat before coming online.
Note: If you have a state, use the Startup command instead.
In this case "Role" is referring to the name of the service, for example "Engine".
Only Store is expected to receive this message, if you should receive it (as a normal Service) you probably want to unsubscribe.
Startup
Sent on connection by a service that maintains a state triggering data fetching from "Store"
Description
Sent by any service that maintains a State when connecting to a network. This will make "Store" go through its memory, find the proper settings for the current Show that you should use and send that to you as a Set message.
If the service doesn’t have any remote function calls implemented, this message can be ignored.
Otherwise, when receiving this message the service should parse the method and arguments and execute the corresponding code. Then the CallResult message should be sent as a response, targeted at the service defined in the "RespondTo" field of the original Call message, passing through the received "ID".
CallResult
Response to a Call
Description
Communicates a result of an RPC executed with a Call command. Depending on whether the original call succeeded or failed the message should contain the "Result" or "Failure" field. The "Result" field is always an object. The "Failure" field can be either a string or an object.