Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 21e1434

Browse files
authored
update to use new docs structure + use latest prerelease SDK (#16)
1 parent d72fa37 commit 21e1434

File tree

5 files changed

+60
-49
lines changed

5 files changed

+60
-49
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ We encourage pull requests and other contributions from the community. Before su
1414

1515
### Prerequisites
1616

17-
This project has multiple target frameworks as described in [`README.md`](./README.md). The .NET Framework target can be built only in a Windows environment; the others can be built either with or without a Windows environment. Download and install the latest .NET SDK tools first.
17+
To set up your SDK build time environment, you must [download .NET development tools and follow the instructions](https://dotnet.microsoft.com/download). .NET 5.0 is preferred, since the .NET 5.0 tools are able to build for all supported target platforms.
1818

1919
The project has a package dependency on `StackExchange.Redis`. The dependency version is intended to be the _minimum_ compatible version; applications are expected to override this with their own dependency on some higher version.
2020

21-
This project has two targets: .NET Standard 2.0 and .NET Framework 4.5.2. In Windows, you can build both; outside of Windows, you will need to [download .NET Core and follow the instructions](https://dotnet.microsoft.com/download) (make sure you have 2.0 or higher) and can only build the .NET Standard target.
21+
The unit test project uses code from the `dotnet-server-sdk-shared-tests` repository which is imported as a subtree. See the `README.md` file in that directory for more information.
2222

2323
### Building
2424

README.md

Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Version 3.0.0 and above of this library works with version 6.0.0 and above of th
1212

1313
It has a dependency on StackExchange.Redis version 2.0.513. If you are using a higher version of StackExchange.Redis, you should install it explicitly as a dependency in your application to override this minimum version.
1414

15+
For full usage details and examples, see the [API reference](launchdarkly.github.io/dotnet-server-sdk-redis).
16+
1517
## Supported .NET versions
1618

1719
This version of the library is built for the following targets:
@@ -21,49 +23,6 @@ This version of the library is built for the following targets:
2123

2224
The .NET build tools should automatically load the most appropriate build of the library for whatever platform your application or library is targeted to.
2325

24-
## Quick setup
25-
26-
This assumes that you have already installed the LaunchDarkly .NET SDK.
27-
28-
1. Use [NuGet](http://docs.nuget.org/docs/start-here/using-the-package-manager-console) to add this package to your project:
29-
30-
Install-Package LaunchDarkly.ServerSdk.Redis
31-
32-
(Previous versions of the library had two package names, because StackExchange.Redis had two different packages depending on whether you wanted strong-naming, but StackExchange.Redis 2.x no longer does this so there is only one LaunchDarkly.ServerSdk.Redis package now.)
33-
34-
2. Import the package (note that the namespace is different from the package name):
35-
36-
using LaunchDarkly.Sdk.Server.Integrations;
37-
38-
3. When configuring your `LdClient`, add the Redis data store as a `PersistentDataStore`. You may specify any custom Redis options using the methods of `RedisDataStoreBuilder`. For instance, to customize the Redis URI:
39-
40-
```csharp
41-
var ldConfig = Configuration.Default("YOUR_SDK_KEY")
42-
.DataStore(
43-
Components.PersistentDataStore(
44-
Redis.DataStore().Uri("redis://my-redis-host")
45-
)
46-
)
47-
.Build();
48-
var ldClient = new LdClient(ldConfig);
49-
```
50-
51-
By default, the store will try to connect to a local Redis instance on port 6379.
52-
53-
## Caching behavior
54-
55-
The LaunchDarkly SDK has a standard caching mechanism for any persistent data store, to reduce database traffic. This is configured through the SDK's `PersistentDataStoreBuilder` class as described in the SDK documentation. For instance, to specify a cache TTL of 5 minutes:
56-
57-
```csharp
58-
var config = Configuration.Default("YOUR_SDK_KEY")
59-
.DataStore(
60-
Components.PersistentDataStore(
61-
Redis.DataStore().Uri("redis://my-redis-host")
62-
).CacheTime(TimeSpan.FromMinutes(5))
63-
)
64-
.Build();
65-
```
66-
6726
## Signing
6827

6928
The published version of this assembly is both digitally signed by LaunchDarkly and [strong-named](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/strong-named-assemblies).

docs-src/index.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
The [`LaunchDarkly.ServerSdk.Redis`](https://nuget.org/packages/LaunchDarkly.ServerSdk.Redis) package provides a Redis-backed persistence mechanism (data store) for the [LaunchDarkly .NET SDK](https://github.com/launchdarkly/dotnet-server-sdk), replacing the default in-memory data store. The underlying Redis client implementation is [`StackExchange.Redis`](https://github.com/StackExchange/StackExchange.Redis).
2+
3+
For more information, see also: [Using a persistent data store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).
4+
5+
Version 3.0.0 and above of this library works with version 6.0.0 and above of the LaunchDarkly .NET SDK. For earlier versions of the SDK, use the latest 1.x release of this library.
6+
7+
It has a dependency on `StackExchange.Redis` version 2.0.513. If you are using a higher version of `StackExchange.Redis`, you should install it explicitly as a dependency in your application to override this minimum version.
8+
9+
The entry point for using this integration is the **<xref:LaunchDarkly.Sdk.Server.Integrations.Redis>** class in <xref:LaunchDarkly.Sdk.Server.Integrations>.
10+
11+
## Quick setup
12+
13+
This assumes that you have already installed the LaunchDarkly .NET SDK.
14+
15+
1. Add the NuGet package [`LaunchDarkly.ServerSdk.Redis`](https://nuget.org/packages/LaunchDarkly.ServerSdk.Redis) to your project.
16+
17+
(Previous versions of the library had two package names, because StackExchange.Redis had two different packages depending on whether you wanted strong-naming, but StackExchange.Redis 2.x no longer does this so there is only one `LaunchDarkly.ServerSdk.Redis` package now.)
18+
19+
2. Import the package (note that the namespace is different from the package name):
20+
21+
```csharp
22+
using LaunchDarkly.Sdk.Server.Integrations;
23+
```
24+
25+
3. When configuring your `LdClient`, add the Redis data store as a `PersistentDataStore`. You may specify any custom Redis options using the methods of `RedisDataStoreBuilder`. For instance, to customize the Redis URI:
26+
27+
```csharp
28+
var ldConfig = Configuration.Default("YOUR_SDK_KEY")
29+
.DataStore(
30+
Components.PersistentDataStore(
31+
Redis.DataStore().Uri("redis://my-redis-host")
32+
)
33+
)
34+
.Build();
35+
var ldClient = new LdClient(ldConfig);
36+
```
37+
38+
By default, the store will try to connect to a local Redis instance on port 6379.
39+
40+
## Caching behavior
41+
42+
The LaunchDarkly SDK has a standard caching mechanism for any persistent data store, to reduce database traffic. This is configured through the SDK's `PersistentDataStoreBuilder` class as described in the SDK documentation. For instance, to specify a cache TTL of 5 minutes:
43+
44+
```csharp
45+
var config = Configuration.Default("YOUR_SDK_KEY")
46+
.DataStore(
47+
Components.PersistentDataStore(
48+
Redis.DataStore().Uri("redis://my-redis-host")
49+
).CacheTime(TimeSpan.FromMinutes(5))
50+
)
51+
.Build();
52+
```

dotnet-server-sdk-shared-tests/LaunchDarkly.ServerSdk.SharedTests/LaunchDarkly.ServerSdk.SharedTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</PropertyGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="LaunchDarkly.ServerSdk" Version="[6.0.0-alpha.9,]" />
17-
<PackageReference Include="LaunchDarkly.Logging" Version="[1.0.0,]" />
16+
<PackageReference Include="LaunchDarkly.ServerSdk" Version="[6.0.0-rc.1,]" />
17+
<PackageReference Include="LaunchDarkly.Logging" Version="[1.0.1,]" />
1818
<PackageReference Include="xunit" Version="2.4.1" />
1919
</ItemGroup>
2020
</Project>

src/LaunchDarkly.ServerSdk.Redis/LaunchDarkly.ServerSdk.Redis.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<Version>3.0.0-alpha.1</Version>
3+
<Version>3.0.0-rc.1</Version>
44
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
55
<AssemblyName>LaunchDarkly.ServerSdk.Redis</AssemblyName>
66
<OutputType>Library</OutputType>
@@ -21,7 +21,7 @@
2121
</PropertyGroup>
2222

2323
<ItemGroup>
24-
<PackageReference Include="LaunchDarkly.ServerSdk" Version="[6.0.0-alpha.9,]" />
24+
<PackageReference Include="LaunchDarkly.ServerSdk" Version="[6.0.0-rc.1,]" />
2525
<PackageReference Include="StackExchange.Redis" Version="[2.0.513,]" />
2626
</ItemGroup>
2727

0 commit comments

Comments
 (0)