Stormancer.Server.Plugins.PeerConfiguration
0.2.1.1-pre
dotnet add package Stormancer.Server.Plugins.PeerConfiguration --version 0.2.1.1-pre
NuGet\Install-Package Stormancer.Server.Plugins.PeerConfiguration -Version 0.2.1.1-pre
<PackageReference Include="Stormancer.Server.Plugins.PeerConfiguration" Version="0.2.1.1-pre" />
paket add Stormancer.Server.Plugins.PeerConfiguration --version 0.2.1.1-pre
#r "nuget: Stormancer.Server.Plugins.PeerConfiguration, 0.2.1.1-pre"
// Install Stormancer.Server.Plugins.PeerConfiguration as a Cake Addin #addin nuget:?package=Stormancer.Server.Plugins.PeerConfiguration&version=0.2.1.1-pre&prerelease // Install Stormancer.Server.Plugins.PeerConfiguration as a Cake Tool #tool nuget:?package=Stormancer.Server.Plugins.PeerConfiguration&version=0.2.1.1-pre&prerelease
Stormancer.Server.Plugins.PeerConfiguration
provides a way to push json configuration from the server to clients on startup and in almost real time whenever the configuration is changed on the server.
Setting up the client configuration on the server
The client configuration is set as a section of the server app configuration. It is automatically pushed to clients whenever the server configuration is updated and there is changes in the client configuration section.
{
"peerConfig":
{
"foo":"bar"
}
}
Receiving the configuration on the client
Adding the plugin
#include "configuration/PeerConfiguration.hpp"
...
//Add the plugin to the stormancer client.
conf->addPlugin(new Stormancer::PeerConfiguration::PeerConfigurationPlugin());
API
The API is exposed by ```
//Gets a boolean indicating whether the configuration is currently available.
//The configuration is first sent just after authentication, so isAvailable returns false before that,
//or if the plugin is not enabled on the server.
bool isAvailable()
//Get the current configuration as a json string. Returns an empty string if the configuration is not available.
std::string get()
//Subscribes to changes to the configuration.
Stormancer::Subscription subscribe(std::function<void(std::string)> callback, bool /*includeAlreadyReceived*/ = true)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Stormancer.Server.Plugins.Configuration (>= 2.1.2.8-pre)
- Stormancer.Server.Plugins.Users (>= 9.1.0.10-pre)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.2.1.1-pre | 81 | 3/11/2024 |
0.2.1-pre | 147 | 12/18/2023 |
0.2.0 | 419 | 6/30/2021 |
Changed
*******
- Don't send config updates if it didn't change.
Added
*****
- Added a readme file.