RaftStatePublisherSettings - robdobsn/RaftCore GitHub Wiki
StatePublisher Settings
| Setting | Description | Type | Example |
|---|---|---|---|
enable |
Enables or disables the state publisher functionality. | bool |
1 |
Note: Publication sources are created dynamically when SysMods register them via the registerDataSource API. There is no need to pre-configure publication topics in the pubList - they are added automatically when registered.
Subscription Parameters
Subscriptions are required for all interfaces. When subscribing via the /subscription REST API, the following parameters are supported:
| Parameter | Description | Type | Example |
|---|---|---|---|
topic |
Topic name to subscribe to (must match a topic in pubList) | string |
"devjson" |
rateHz |
The rate at which the publication is sent (in Hz). Use 0 to disable. | float |
10.0, 1.0, 0.1 |
trigger |
Override the trigger type defined in config (optional) | string |
"change", "time", "timeorchange" |
minTimeBetweenMs |
Minimum time between messages in milliseconds (optional) | integer |
100, 50, 1000 |
Example JSON
"Publish": {
"enable": 1
}
Note: Publication topics are automatically created when SysMods register as data sources. No pre-configuration in pubList is required.
Example Subscription Request
Clients must subscribe to topics via the REST API. Topics are automatically created when SysMods register as data sources:
{
"action": "update",
"pubRecs": [
{
"topic": "MyStatus",
"rateHz": 10.0,
"trigger": "timeorchange",
"minTimeBetweenMs": 100
}
]
}