Stormancer.Server.Plugins.PeerConfiguration 0.2.1.1-pre

This is a prerelease version of Stormancer.Server.Plugins.PeerConfiguration.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Stormancer.Server.Plugins.PeerConfiguration" Version="0.2.1.1-pre" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Stormancer.Server.Plugins.PeerConfiguration --version 0.2.1.1-pre
#r "nuget: Stormancer.Server.Plugins.PeerConfiguration, 0.2.1.1-pre"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 58 3/11/2024
0.2.1-pre 105 12/18/2023
0.2.0 383 6/30/2021

Changed
*******
- Don't send config updates if it didn't change.
Added
*****
- Added a readme file.