Commit af605dd6 authored by Marc Gravell's avatar Marc Gravell

Merge branch 'jeremymeng-netcore' of...

Merge branch 'jeremymeng-netcore' of github.com:StackExchange/StackExchange.Redis into jeremymeng-netcore
parents 2712ccf9 42593761
.hg .hg
bin bin
bin.snk bin.snk
obj obj
*.suo *.suo
*.user *.user
*.nupkg *.nupkg
packages/NuGet.CommandLine.* packages/NuGet.CommandLine.*
*.sln.docstates *.sln.docstates
_ReSharper.* _ReSharper.*
Mono/ Mono/
*.sln.ide *.sln.ide
*.rdb *.rdb
*.aof *.aof
*.orig *.orig
redis-cli.exe redis-cli.exe
Redis Configs/*.dat Redis Configs/*.dat
RedisQFork*.dat RedisQFork*.dat
StackExchange.Redis.*.zip StackExchange.Redis.*.zip
.vs/ .vs/
*.lock.json *.lock.json
\ No newline at end of file
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj"> <Folder Include="Properties\" />
<Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project>
<Name>StackExchange.Redis</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Properties\" /> <ProjectReference Include="..\StackExchange.Redis_Net45\StackExchange.Redis_Net45.csproj">
<Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project>
<Name>StackExchange.Redis_Net45</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
{ {
"version": "1.0.0-*", "version": "1.0.0-*",
"description": "StackExchange.Redis.BasicTest dnxcore50", "description": "StackExchange.Redis.BasicTest dnxcore50",
"authors": [ "jeremymeng" ], "authors": [ "" ],
"tags": [ "" ], "tags": [ "" ],
"projectUrl": "", "projectUrl": "",
"licenseUrl": "", "licenseUrl": "",
...@@ -9,11 +9,12 @@ ...@@ -9,11 +9,12 @@
"compile": [ "compile": [
"../BasicTest/Program.cs" "../BasicTest/Program.cs"
], ],
"dependencies": { "dependencies": {
"StackExchange.Redis": "1.1.0-*" "StackExchange.Redis": {
"version": "1.1.0-alpha1",
"target": "project"
}
}, },
"commands": { "commands": {
"run": "BasicTest_dnxcore50" "run": "BasicTest_dnxcore50"
}, },
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
"frameworks": { "frameworks": {
"dnxcore50": { "dnxcore50": {
"dependencies": { "dependencies": {
"System.Console": "4.0.0-beta-23409" "System.Console": "4.0.0-beta-23516"
} }
} }
} }
......
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj"> <ProjectReference Include="..\StackExchange.Redis_Net45\StackExchange.Redis_Net45.csproj">
<Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project> <Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project>
<Name>StackExchange.Redis</Name> <Name>StackExchange.Redis_Net45</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
...@@ -87,13 +87,13 @@ ...@@ -87,13 +87,13 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj"> <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
<Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project>
<Name>StackExchange.Redis</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> <ProjectReference Include="..\StackExchange.Redis_Net45\StackExchange.Redis_Net45.csproj">
<Project>{7cec07f2-8c03-4c42-b048-738b215824c1}</Project>
<Name>StackExchange.Redis_Net45</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0.24720" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.24720</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>46754d2a-ac16-4686-b113-3db08acf4269</ProjectGuid>
<RootNamespace>StackExchange.Redis.StrongName</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
\ No newline at end of file
{
"version": "1.1.0-alpha1",
"description": "High performance Redis client, incorporating both synchronous and asynchronous usage.",
"authors": [ "Stack Exchange inc., marc.gravell" ],
"owners": [ "marc.gravell" ],
"tags": [ "Async", "Redis", "Cache", "PubSub", "Messaging" ],
"projectUrl": "https://github.com/StackExchange/StackExchange.Redis",
"licenseUrl": "https://raw.github.com/StackExchange/StackExchange.Redis/master/LICENSE",
"copyright": "Stack Exchange inc. 2014-",
"requireLicenseAcceptance": false,
"summary": "Redis client library",
"compile": [
"../StackExchange.Redis/**/*.cs"
],
"dependencies": {
},
"compilationOptions": {
"allowUnsafe": true,
"keyFile": "../StackExchange.Redis.snk",
"define": [ "STRONG_NAME" ]
},
"frameworks": {
"net40": {
"dependencies": {
"Microsoft.Bcl": "1.1.10",
"Microsoft.Bcl.Async": "1.0.168"
},
"compilationOptions": {
"define": [ "FEATURE_SERIALIZATION" ]
}
},
"net45": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"compilationOptions": {
"define": [ "FEATURE_SERIALIZATION" ]
}
},
"net46": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"define": [ "FEATURE_SERIALIZATION", "PLAT_SAFE_CONTINUATIONS" ]
},
"dnxcore50": {
"compilationOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
},
"dependencies": {
"System.Collections.Concurrent": "4.0.11-beta-23516",
"System.Collections.NonGeneric": "4.0.1-beta-23516",
"System.Diagnostics.Debug": "4.0.11-beta-23516",
"System.Diagnostics.Tools": "4.0.1-beta-23516",
"System.Diagnostics.TraceSource": "4.0.0-beta-23516",
"System.Globalization": "4.0.11-beta-23516",
"System.IO": "4.0.11-beta-23516",
"System.IO.Compression": "4.1.0-beta-23516",
"System.IO.FileSystem": "4.0.1-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Net.NameResolution": "4.0.0-beta-23516",
"System.Net.Primitives": "4.0.11-beta-23516",
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.Sockets": "4.1.0-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.Emit": "4.0.1-beta-23516",
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
"System.Text.RegularExpressions": "4.0.11-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Threading.Tasks": "4.0.11-beta-23516",
"System.Threading.Thread": "4.0.0-beta-23516",
"System.Threading.ThreadPool": "4.0.10-beta-23516",
"System.Threading.Timer": "4.0.1-beta-23516"
}
},
"dotnet5.5": {
"compilationOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
},
"dependencies": {
"System.Collections.Concurrent": "4.0.11-beta-23516",
"System.Collections.NonGeneric": "4.0.1-beta-23516",
"System.Diagnostics.Debug": "4.0.11-beta-23516",
"System.Diagnostics.Tools": "4.0.1-beta-23516",
"System.Diagnostics.TraceSource": "4.0.0-beta-23516",
"System.Globalization": "4.0.11-beta-23516",
"System.IO": "4.0.11-beta-23516",
"System.IO.Compression": "4.1.0-beta-23516",
"System.IO.FileSystem": "4.0.1-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Net.NameResolution": "4.0.0-beta-23516",
"System.Net.Primitives": "4.0.11-beta-23516",
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.Sockets": "4.1.0-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.Emit": "4.0.1-beta-23516",
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
"System.Text.RegularExpressions": "4.0.11-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Threading.Tasks": "4.0.11-beta-23516",
"System.Threading.Thread": "4.0.0-beta-23516",
"System.Threading.ThreadPool": "4.0.10-beta-23516",
"System.Threading.Timer": "4.0.1-beta-23516"
}
}
}
}
\ No newline at end of file
This diff is collapsed.
...@@ -20,7 +20,7 @@ public class Cluster : TestBase ...@@ -20,7 +20,7 @@ public class Cluster : TestBase
protected override string GetConfiguration() protected override string GetConfiguration()
{ {
var server = ClusterIp; var server = ClusterIp;
#if !DNXCORE50 #if !CORE_CLR
if (string.Equals(Environment.MachineName, "MARC-LAPTOP", StringComparison.InvariantCultureIgnoreCase)) if (string.Equals(Environment.MachineName, "MARC-LAPTOP", StringComparison.InvariantCultureIgnoreCase))
#else #else
if (string.Equals(Environment.GetEnvironmentVariable("COMPUTERNAME"), "MARC-LAPTOP", StringComparison.OrdinalIgnoreCase)) if (string.Equals(Environment.GetEnvironmentVariable("COMPUTERNAME"), "MARC-LAPTOP", StringComparison.OrdinalIgnoreCase))
......
...@@ -147,7 +147,7 @@ public void ReadConfig() ...@@ -147,7 +147,7 @@ public void ReadConfig()
var all = conn.ConfigGet(); var all = conn.ConfigGet();
Assert.IsTrue(all.Length > 0, "any"); Assert.IsTrue(all.Length > 0, "any");
#if !DNXCORE50 #if !CORE_CLR
var pairs = all.ToDictionary(x => (string)x.Key, x => (string)x.Value, StringComparer.InvariantCultureIgnoreCase); var pairs = all.ToDictionary(x => (string)x.Key, x => (string)x.Value, StringComparer.InvariantCultureIgnoreCase);
#else #else
var pairs = all.ToDictionary(x => (string)x.Key, x => (string)x.Value, StringComparer.OrdinalIgnoreCase); var pairs = all.ToDictionary(x => (string)x.Key, x => (string)x.Value, StringComparer.OrdinalIgnoreCase);
......
...@@ -150,7 +150,7 @@ public void CheckSyncAsyncMethodsMatch(Type from, Type to) ...@@ -150,7 +150,7 @@ public void CheckSyncAsyncMethodsMatch(Type from, Type to)
var pFrom = method.GetParameters(); var pFrom = method.GetParameters();
Type[] args = pFrom.Select(x => x.ParameterType).ToArray(); Type[] args = pFrom.Select(x => x.ParameterType).ToArray();
Assert.AreEqual(typeof(CommandFlags), args.Last()); Assert.AreEqual(typeof(CommandFlags), args.Last());
#if !DNXCORE50 #if !CORE_CLR
var found = to.GetMethod(huntName, flags, null, method.CallingConvention, args, null); var found = to.GetMethod(huntName, flags, null, method.CallingConvention, args, null);
#else #else
var found = to.GetMethods(flags) var found = to.GetMethods(flags)
...@@ -176,14 +176,14 @@ void CheckMethod(MethodInfo method, bool isAsync) ...@@ -176,14 +176,14 @@ void CheckMethod(MethodInfo method, bool isAsync)
{ {
#if DEBUG #if DEBUG
#if !DNXCORE50 #if !CORE_CLR
bool ignorePrefix = ignoreType != null && Attribute.IsDefined(method, ignoreType); bool ignorePrefix = ignoreType != null && Attribute.IsDefined(method, ignoreType);
#else #else
bool ignorePrefix = ignoreType != null && method.IsDefined(ignoreType); bool ignorePrefix = ignoreType != null && method.IsDefined(ignoreType);
#endif #endif
if (ignorePrefix) if (ignorePrefix)
{ {
#if !DNXCORE50 #if !CORE_CLR
Attribute attrib = Attribute.GetCustomAttribute(method, ignoreType); Attribute attrib = Attribute.GetCustomAttribute(method, ignoreType);
#else #else
Attribute attrib = method.GetCustomAttribute(ignoreType); Attribute attrib = method.GetCustomAttribute(ignoreType);
...@@ -228,7 +228,7 @@ void CheckName(MemberInfo member, bool isAsync) ...@@ -228,7 +228,7 @@ void CheckName(MemberInfo member, bool isAsync)
public static class ReflectionExtensions public static class ReflectionExtensions
{ {
#if !DNXCORE50 #if !CORE_CLR
public static Type GetTypeInfo(this Type type) public static Type GetTypeInfo(this Type type)
{ {
return type; return type;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
#if DNXCORE50 #if CORE_CLR
using System.Reflection; using System.Reflection;
#endif #endif
using System.Threading.Tasks; using System.Threading.Tasks;
......
#if NUNITLITE
using System; using System;
using System.Reflection; using System.Reflection;
using NUnitLite; using NUnitLite;
...@@ -11,4 +12,5 @@ public int Main(string[] args) ...@@ -11,4 +12,5 @@ public int Main(string[] args)
return new AutoRun().Execute(typeof(TestBase).GetTypeInfo().Assembly, Console.Out, Console.In, args); return new AutoRun().Execute(typeof(TestBase).GetTypeInfo().Assembly, Console.Out, Console.In, args);
} }
} }
} }
\ No newline at end of file #endif
\ No newline at end of file
...@@ -417,7 +417,7 @@ internal static class VolatileWrapper ...@@ -417,7 +417,7 @@ internal static class VolatileWrapper
{ {
public static int Read(ref int location) public static int Read(ref int location)
{ {
#if !DNXCORE50 #if !CORE_CLR
return Thread.VolatileRead(ref location); return Thread.VolatileRead(ref location);
#else #else
return Volatile.Read(ref location); return Volatile.Read(ref location);
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0.24720" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.24720</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>a51dca17-e8f1-44e1-9a37-328fab14d2ce</ProjectGuid> <ProjectGuid>3b8bd8f1-8bfc-4d8c-b4da-25ffaf3d1dbe</ProjectGuid>
<RootNamespace>StackExchange.Redis.Tests</RootNamespace> <RootNamespace>StackExchange.Redis.Tests</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\StackExchange.Redis_dnxcore50\StackExchange.Redis\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\StackExchange.Redis_dnxcore50\StackExchange.Redis\artifacts\bin\$(MSBuildProjectName)\</OutputPath> <OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
......
...@@ -246,7 +246,7 @@ private static RedisConnection GetOldStyleConnection(string host, int port, bool ...@@ -246,7 +246,7 @@ private static RedisConnection GetOldStyleConnection(string host, int port, bool
protected static TimeSpan RunConcurrent(Action work, int threads, int timeout = 10000, [CallerMemberName] string caller = null) protected static TimeSpan RunConcurrent(Action work, int threads, int timeout = 10000, [CallerMemberName] string caller = null)
{ {
if (work == null) throw new ArgumentNullException("work"); if (work == null) throw new ArgumentNullException("work");
if (threads < 1) throw new ArgumentOutOfRangeException("theads"); if (threads < 1) throw new ArgumentOutOfRangeException("threads");
if(string.IsNullOrWhiteSpace(caller)) caller = Me(); if(string.IsNullOrWhiteSpace(caller)) caller = Me();
Stopwatch watch = null; Stopwatch watch = null;
ManualResetEvent allDone = new ManualResetEvent(false); ManualResetEvent allDone = new ManualResetEvent(false);
...@@ -285,7 +285,7 @@ protected static TimeSpan RunConcurrent(Action work, int threads, int timeout = ...@@ -285,7 +285,7 @@ protected static TimeSpan RunConcurrent(Action work, int threads, int timeout =
} }
if (!allDone.WaitOne(timeout)) if (!allDone.WaitOne(timeout))
{ {
#if !DNXCORE50 #if !CORE_CLR
for (int i = 0; i < threads; i++) for (int i = 0; i < threads; i++)
{ {
var thd = threadArr[i]; var thd = threadArr[i];
......
using System; using System;
using NUnit.Framework; using NUnit.Framework;
using StackExchange.Redis.KeyspaceIsolation; using StackExchange.Redis.KeyspaceIsolation;
namespace StackExchange.Redis.Tests namespace StackExchange.Redis.Tests
{ {
[TestFixture] [TestFixture]
public class WithKeyPrefixTests : TestBase public class WithKeyPrefixTests : TestBase
{ {
[Test] [Test]
public void BlankPrefixYieldsSame_Bytes() public void BlankPrefixYieldsSame_Bytes()
{ {
using (var conn = Create()) using (var conn = Create())
{ {
var raw = conn.GetDatabase(1); var raw = conn.GetDatabase(1);
var prefixed = raw.WithKeyPrefix(new byte[0]); var prefixed = raw.WithKeyPrefix(new byte[0]);
Assert.AreSame(raw, prefixed); Assert.AreSame(raw, prefixed);
} }
} }
[Test] [Test]
public void BlankPrefixYieldsSame_String() public void BlankPrefixYieldsSame_String()
{ {
using (var conn = Create()) using (var conn = Create())
{ {
var raw = conn.GetDatabase(1); var raw = conn.GetDatabase(1);
var prefixed = raw.WithKeyPrefix(""); var prefixed = raw.WithKeyPrefix("");
Assert.AreSame(raw, prefixed); Assert.AreSame(raw, prefixed);
} }
} }
[Test] [Test]
public void NullPrefixIsError_Bytes() public void NullPrefixIsError_Bytes()
{ {
Assert.Throws<ArgumentNullException>(() => { Assert.Throws<ArgumentNullException>(() => {
using (var conn = Create()) using (var conn = Create())
{ {
var raw = conn.GetDatabase(1); var raw = conn.GetDatabase(1);
var prefixed = raw.WithKeyPrefix((byte[])null); var prefixed = raw.WithKeyPrefix((byte[])null);
} }
}); });
} }
[Test]
[Test] public void NullPrefixIsError_String()
public void NullPrefixIsError_String() {
{ Assert.Throws<ArgumentNullException>(() => {
Assert.Throws<ArgumentNullException>(() => { using (var conn = Create())
using (var conn = Create()) {
{ var raw = conn.GetDatabase(1);
var raw = conn.GetDatabase(1); var prefixed = raw.WithKeyPrefix((string)null);
var prefixed = raw.WithKeyPrefix((string)null); }
} });
}); }
}
[Test]
[Test] [TestCase("abc")]
[TestCase("abc")] [TestCase("")]
[TestCase("")] [TestCase(null)]
[TestCase(null)] public void NullDatabaseIsError(string prefix)
public void NullDatabaseIsError(string prefix) {
{ Assert.Throws<ArgumentNullException>(() => {
Assert.Throws<ArgumentNullException>(() => { IDatabase raw = null;
IDatabase raw = null; var prefixed = raw.WithKeyPrefix(prefix);
var prefixed = raw.WithKeyPrefix(prefix); });
}); }
} [Test]
public void BasicSmokeTest()
[Test] {
public void BasicSmokeTest() using(var conn = Create())
{ {
using(var conn = Create()) var raw = conn.GetDatabase(1);
{
var raw = conn.GetDatabase(1); var foo = raw.WithKeyPrefix("foo");
var foobar = foo.WithKeyPrefix("bar");
var foo = raw.WithKeyPrefix("foo");
var foobar = foo.WithKeyPrefix("bar"); string key = Me();
string key = Me(); string s = Guid.NewGuid().ToString(), t = Guid.NewGuid().ToString();
string s = Guid.NewGuid().ToString(), t = Guid.NewGuid().ToString(); foo.StringSet(key, s);
var val = (string)foo.StringGet(key);
foo.StringSet(key, s); Assert.AreEqual(s, val); // fooBasicSmokeTest
var val = (string)foo.StringGet(key);
Assert.AreEqual(s, val); // fooBasicSmokeTest foobar.StringSet(key, t);
val = (string)foobar.StringGet(key);
foobar.StringSet(key, t); Assert.AreEqual(t, val); // foobarBasicSmokeTest
val = (string)foobar.StringGet(key);
Assert.AreEqual(t, val); // foobarBasicSmokeTest val = (string)foo.StringGet("bar" + key);
Assert.AreEqual(t, val); // foobarBasicSmokeTest
val = (string)foo.StringGet("bar" + key);
Assert.AreEqual(t, val); // foobarBasicSmokeTest val = (string)raw.StringGet("foo" + key);
Assert.AreEqual(s, val); // fooBasicSmokeTest
val = (string)raw.StringGet("foo" + key);
Assert.AreEqual(s, val); // fooBasicSmokeTest val = (string)raw.StringGet("foobar" + key);
Assert.AreEqual(t, val); // foobarBasicSmokeTest
val = (string)raw.StringGet("foobar" + key); }
Assert.AreEqual(t, val); // foobarBasicSmokeTest }
} [Test]
} public void ConditionTest()
[Test] {
public void ConditionTest() using(var conn = Create())
{ {
using(var conn = Create()) var raw = conn.GetDatabase(2);
{
var raw = conn.GetDatabase(2); var foo = raw.WithKeyPrefix("tran:");
var foo = raw.WithKeyPrefix("tran:"); raw.KeyDelete("tran:abc");
raw.KeyDelete("tran:i");
raw.KeyDelete("tran:abc");
raw.KeyDelete("tran:i"); // execute while key exists
raw.StringSet("tran:abc", "def");
// execute while key exists var tran = foo.CreateTransaction();
raw.StringSet("tran:abc", "def"); tran.AddCondition(Condition.KeyExists("abc"));
var tran = foo.CreateTransaction(); tran.StringIncrementAsync("i");
tran.AddCondition(Condition.KeyExists("abc")); tran.Execute();
tran.StringIncrementAsync("i");
tran.Execute(); int i = (int)raw.StringGet("tran:i");
Assert.AreEqual(1, i);
int i = (int)raw.StringGet("tran:i");
Assert.AreEqual(1, i); // repeat without key
raw.KeyDelete("tran:abc");
// repeat without key tran = foo.CreateTransaction();
raw.KeyDelete("tran:abc"); tran.AddCondition(Condition.KeyExists("abc"));
tran = foo.CreateTransaction(); tran.StringIncrementAsync("i");
tran.AddCondition(Condition.KeyExists("abc")); tran.Execute();
tran.StringIncrementAsync("i");
tran.Execute(); i = (int)raw.StringGet("tran:i");
Assert.AreEqual(1, i);
i = (int)raw.StringGet("tran:i"); }
Assert.AreEqual(1, i); }
} }
} }
}
}
...@@ -16,7 +16,6 @@ public sealed class WrapperBaseTests ...@@ -16,7 +16,6 @@ public sealed class WrapperBaseTests
private Mock<IDatabaseAsync> mock; private Mock<IDatabaseAsync> mock;
private WrapperBase<IDatabaseAsync> wrapper; private WrapperBase<IDatabaseAsync> wrapper;
//[TestFixtureSetUp]
[OneTimeSetUp] [OneTimeSetUp]
public void Initialize() public void Initialize()
{ {
...@@ -891,4 +890,4 @@ public void StringSetRangeAsync() ...@@ -891,4 +890,4 @@ public void StringSetRangeAsync()
} }
} }
} }
#endif #endif
\ No newline at end of file
{ {
"version": "1.0.0-*", "version": "1.0.0-*",
"description": "StackExchange.Redis.Tests", "description": "StackExchange.Redis.Tests",
"authors": [ "jeremymeng" ], "authors": [ "" ],
"tags": [ "" ], "tags": [ "" ],
"projectUrl": "", "projectUrl": "",
"licenseUrl": "", "licenseUrl": "",
"compile": [
"../../StackExchange.Redis.Tests/**/*.cs"
],
"dependencies": { "dependencies": {
"StackExchange.Redis": "1.1.0-*" "StackExchange.Redis": {
"version": "1.1.0-alpha1",
"target": "project"
}
}, },
"commands": { "commands": {
"run": "StackExchange.Redis.Tests" "run": "StackExchange.Redis.Tests"
}, },
"compilationOptions": { "define": [ "NUNITLITE" ] },
"configurations": {
"Debug": {
"compilationOptions": {
"define": [ "DEBUG", "TRACE", "PLAT_SAFE_CONTINUATIONS" ]
}
},
"Release": {
"compilationOptions": {
"define": [ "TRACE", "PLAT_SAFE_CONTINUATIONS" ]
}
}
},
"frameworks": { "frameworks": {
"dnxcore50": { "dnxcore50": {
"compilationOptions": { "define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ] },
"dependencies": { "dependencies": {
"System.Console": "4.0.0-beta-*", "System.Console": "4.0.0-beta-23516",
"System.Linq.Expressions": "4.0.11-beta-23409", "System.Linq.Expressions": "4.0.11-beta-23516",
"System.Reflection.Extensions": "4.0.1-beta-23409", "System.Reflection.Extensions": "4.0.1-beta-23516",
"System.Threading.Tasks.Parallel": "4.0.1-beta-23409", "System.Threading.Tasks.Parallel": "4.0.1-beta-23516",
"Microsoft.CSharp": "4.0.1-beta-23409", "Microsoft.CSharp": "4.0.1-beta-23516",
"nunitlite": "3.0.0" "nunitlite": "3.0.0"
} }
} }
......
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 14
VisualStudioVersion = 14.0.24709.0 VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis", "StackExchange.Redis_dnxcore50\StackExchange.Redis\StackExchange.Redis.xproj", "{86526B5C-1163-4481-A5E2-A303A0BB1535}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicTest_dnxcore50", "BasicTest_dnxcore50\BasicTest_dnxcore50.xproj", "{9D83BABA-A92E-495F-BF63-DEB4F6B09355}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.Tests", "StackExchange.Redis.Tests_dnxcore50\StackExchange.Redis.Tests\StackExchange.Redis.Tests.xproj", "{A51DCA17-E8F1-44E1-9A37-328FAB14D2CE}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis", "StackExchange.Redis\StackExchange.Redis.xproj", "{EF84877F-59BE-41BE-9013-E765AF0BB72E}"
EndProject EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicTest_dnxcore50", "BasicTest_dnxcore50\BasicTest_dnxcore50.xproj", "{9D83BABA-A92E-495F-BF63-DEB4F6B09355}" Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.StrongName", "StackExchange.Redis.StrongName\StackExchange.Redis.StrongName.xproj", "{46754D2A-AC16-4686-B113-3DB08ACF4269}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StackExchange.Redis.Tests", "StackExchange.Redis.Tests\StackExchange.Redis.Tests.xproj", "{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
...@@ -15,18 +17,22 @@ Global ...@@ -15,18 +17,22 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{86526B5C-1163-4481-A5E2-A303A0BB1535}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86526B5C-1163-4481-A5E2-A303A0BB1535}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86526B5C-1163-4481-A5E2-A303A0BB1535}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86526B5C-1163-4481-A5E2-A303A0BB1535}.Release|Any CPU.Build.0 = Release|Any CPU
{A51DCA17-E8F1-44E1-9A37-328FAB14D2CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A51DCA17-E8F1-44E1-9A37-328FAB14D2CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A51DCA17-E8F1-44E1-9A37-328FAB14D2CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A51DCA17-E8F1-44E1-9A37-328FAB14D2CE}.Release|Any CPU.Build.0 = Release|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Debug|Any CPU.Build.0 = Debug|Any CPU {9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Release|Any CPU.ActiveCfg = Release|Any CPU {9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Release|Any CPU.Build.0 = Release|Any CPU {9D83BABA-A92E-495F-BF63-DEB4F6B09355}.Release|Any CPU.Build.0 = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF84877F-59BE-41BE-9013-E765AF0BB72E}.Release|Any CPU.Build.0 = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46754D2A-AC16-4686-B113-3DB08ACF4269}.Release|Any CPU.Build.0 = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B8BD8F1-8BFC-4D8C-B4DA-25FFAF3D1DBE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis.md", "StackExchange.Redis\StackExchange.Redis.md.csproj", "{8EA21FC8-9CF7-438B-94F2-42E3810C3641}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8EA21FC8-9CF7-438B-94F2-42E3810C3641}.Debug|x86.ActiveCfg = Debug|x86
{8EA21FC8-9CF7-438B-94F2-42E3810C3641}.Debug|x86.Build.0 = Debug|x86
{8EA21FC8-9CF7-438B-94F2-42E3810C3641}.Release|x86.ActiveCfg = Release|x86
{8EA21FC8-9CF7-438B-94F2-42E3810C3641}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = StackExchange.Redis.md\StackExchange.Redis.md.csproj
EndGlobalSection
EndGlobal
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<authors>Stack Exchange inc., marc.gravell</authors> <authors>Stack Exchange inc., marc.gravell</authors>
<owners>Stack Exchange inc., marc.gravell</owners> <owners>Stack Exchange inc., marc.gravell</owners>
<summary>Redis client library</summary> <summary>Redis client library</summary>
<description>High performance Redis client, incorporating both synchronous and asynchronous usage; the notional successor to BookSleeve. If you require a strong-named version, try StackExchange.Redis.StrongName</description> <description></description>
<tags>Async Redis NoSQL Client Distributed Cache PubSub Messaging</tags> <tags>Async Redis NoSQL Client Distributed Cache PubSub Messaging</tags>
<language>en-US</language> <language>en-US</language>
<projectUrl>https://github.com/StackExchange/StackExchange.Redis</projectUrl> <projectUrl>https://github.com/StackExchange/StackExchange.Redis</projectUrl>
......
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio 14
VisualStudioVersion = 14.0.24606.1 VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis", "StackExchange.Redis\StackExchange.Redis.csproj", "{7CEC07F2-8C03-4C42-B048-738B215824C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis.Tests", "StackExchange.Redis.Tests\StackExchange.Redis.Tests.csproj", "{19C00111-1328-4089-8565-94920B5B47F2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D3090DF1-8760-4FE2-A595-4C8AC12854ED}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D3090DF1-8760-4FE2-A595-4C8AC12854ED}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.nuget\packages.config = .nuget\packages.config .nuget\packages.config = .nuget\packages.config
...@@ -52,14 +48,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MigratedBookSleeveTestSuite ...@@ -52,14 +48,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MigratedBookSleeveTestSuite
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net40", "StackExchange.Redis_Net40\StackExchange.Redis_Net40.csproj", "{36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net40", "StackExchange.Redis_Net40\StackExchange.Redis_Net40.csproj", "{36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis.StrongName", "StackExchange.Redis\StackExchange.Redis.StrongName.csproj", "{EBF46088-E318-4D32-9EFB-01EF130A4554}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net40.StrongName", "StackExchange.Redis_Net40\StackExchange.Redis_Net40.StrongName.csproj", "{75CED009-AAC6-4AC1-9C38-A0530619062D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net40.StrongName", "StackExchange.Redis_Net40\StackExchange.Redis_Net40.StrongName.csproj", "{75CED009-AAC6-4AC1-9C38-A0530619062D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net46", "StackExchange.Redis_Net46\StackExchange.Redis_Net46.csproj", "{8C473A6F-B0DE-4ADD-88F8-C41B441E407C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net46", "StackExchange.Redis_Net46\StackExchange.Redis_Net46.csproj", "{8C473A6F-B0DE-4ADD-88F8-C41B441E407C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net46.StrongName", "StackExchange.Redis_Net46\StackExchange.Redis_Net46.StrongName.csproj", "{8CE5D027-E332-42DD-BA54-16310DCD529C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net46.StrongName", "StackExchange.Redis_Net46\StackExchange.Redis_Net46.StrongName.csproj", "{8CE5D027-E332-42DD-BA54-16310DCD529C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net45", "StackExchange.Redis_Net45\StackExchange.Redis_Net45.csproj", "{7CEC07F2-8C03-4C42-B048-738B215824C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis_Net45.StrongName", "StackExchange.Redis_Net45\StackExchange.Redis_Net45.StrongName.csproj", "{EBF46088-E318-4D32-9EFB-01EF130A4554}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StackExchange.Redis.Tests_Net46", "StackExchange.Redis.Tests_Net46\StackExchange.Redis.Tests_Net46.csproj", "{19C00111-1328-4089-8565-94920B5B47F2}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -69,26 +69,6 @@ Global ...@@ -69,26 +69,6 @@ Global
Verbose|Any CPU = Verbose|Any CPU Verbose|Any CPU = Verbose|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Log Output|Any CPU.Build.0 = Log Output|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Mono|Any CPU.Build.0 = Mono|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Release|Any CPU.Build.0 = Release|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Log Output|Any CPU.Build.0 = Log Output|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Mono|Any CPU.Build.0 = Mono|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Release|Any CPU.Build.0 = Release|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
{6756F911-BD09-4226-B597-67871DEB8ED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6756F911-BD09-4226-B597-67871DEB8ED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6756F911-BD09-4226-B597-67871DEB8ED5}.Debug|Any CPU.Build.0 = Debug|Any CPU {6756F911-BD09-4226-B597-67871DEB8ED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6756F911-BD09-4226-B597-67871DEB8ED5}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU {6756F911-BD09-4226-B597-67871DEB8ED5}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
...@@ -139,16 +119,6 @@ Global ...@@ -139,16 +119,6 @@ Global
{36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}.Release|Any CPU.Build.0 = Release|Any CPU {36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}.Release|Any CPU.Build.0 = Release|Any CPU
{36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}.Verbose|Any CPU.ActiveCfg = Release|Any CPU {36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}.Verbose|Any CPU.ActiveCfg = Release|Any CPU
{36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}.Verbose|Any CPU.Build.0 = Release|Any CPU {36CAC6B6-2B88-447F-AA35-D4DAA5E4F2C7}.Verbose|Any CPU.Build.0 = Release|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Log Output|Any CPU.Build.0 = Log Output|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Mono|Any CPU.Build.0 = Mono|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Release|Any CPU.Build.0 = Release|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
{75CED009-AAC6-4AC1-9C38-A0530619062D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {75CED009-AAC6-4AC1-9C38-A0530619062D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75CED009-AAC6-4AC1-9C38-A0530619062D}.Debug|Any CPU.Build.0 = Debug|Any CPU {75CED009-AAC6-4AC1-9C38-A0530619062D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75CED009-AAC6-4AC1-9C38-A0530619062D}.Log Output|Any CPU.ActiveCfg = Release|Any CPU {75CED009-AAC6-4AC1-9C38-A0530619062D}.Log Output|Any CPU.ActiveCfg = Release|Any CPU
...@@ -179,6 +149,36 @@ Global ...@@ -179,6 +149,36 @@ Global
{8CE5D027-E332-42DD-BA54-16310DCD529C}.Release|Any CPU.Build.0 = Release|Any CPU {8CE5D027-E332-42DD-BA54-16310DCD529C}.Release|Any CPU.Build.0 = Release|Any CPU
{8CE5D027-E332-42DD-BA54-16310DCD529C}.Verbose|Any CPU.ActiveCfg = Mono|Any CPU {8CE5D027-E332-42DD-BA54-16310DCD529C}.Verbose|Any CPU.ActiveCfg = Mono|Any CPU
{8CE5D027-E332-42DD-BA54-16310DCD529C}.Verbose|Any CPU.Build.0 = Mono|Any CPU {8CE5D027-E332-42DD-BA54-16310DCD529C}.Verbose|Any CPU.Build.0 = Mono|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Log Output|Any CPU.Build.0 = Log Output|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Mono|Any CPU.Build.0 = Mono|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Release|Any CPU.Build.0 = Release|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{7CEC07F2-8C03-4C42-B048-738B215824C1}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Log Output|Any CPU.Build.0 = Log Output|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Mono|Any CPU.Build.0 = Mono|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Release|Any CPU.Build.0 = Release|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{EBF46088-E318-4D32-9EFB-01EF130A4554}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Log Output|Any CPU.ActiveCfg = Log Output|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Log Output|Any CPU.Build.0 = Log Output|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Mono|Any CPU.ActiveCfg = Mono|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Mono|Any CPU.Build.0 = Mono|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Release|Any CPU.Build.0 = Release|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Verbose|Any CPU.ActiveCfg = Verbose|Any CPU
{19C00111-1328-4089-8565-94920B5B47F2}.Verbose|Any CPU.Build.0 = Verbose|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8EA21FC8-9CF7-438B-94F2-42E3810C3641}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>StackExchange.Redis.md</RootNamespace>
<AssemblyName>StackExchange.Redis.md</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;MONO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<ConsolePause>false</ConsolePause>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>MONO</DefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StackExchange\Redis\Aggregate.cs" />
<Compile Include="StackExchange\Redis\Bitwise.cs" />
<Compile Include="StackExchange\Redis\ClientFlags.cs" />
<Compile Include="StackExchange\Redis\ClientInfo.cs" />
<Compile Include="StackExchange\Redis\ClusterConfiguration.cs" />
<Compile Include="StackExchange\Redis\CommandFlags.cs" />
<Compile Include="StackExchange\Redis\CommandMap.cs" />
<Compile Include="StackExchange\Redis\CommandTrace.cs" />
<Compile Include="StackExchange\Redis\CompletedDefaultTask.cs" />
<Compile Include="StackExchange\Redis\CompletionManager.cs" />
<Compile Include="StackExchange\Redis\Condition.cs" />
<Compile Include="StackExchange\Redis\ConfigurationOptions.cs" />
<Compile Include="StackExchange\Redis\ConnectionCounters.cs" />
<Compile Include="StackExchange\Redis\ConnectionFailedEventArgs.cs" />
<Compile Include="StackExchange\Redis\ConnectionFailureType.cs" />
<Compile Include="StackExchange\Redis\ConnectionMultiplexer.cs" />
<Compile Include="StackExchange\Redis\ConnectionMultiplexer.ReaderWriter.cs" />
<Compile Include="StackExchange\Redis\ConnectionType.cs" />
<Compile Include="StackExchange\Redis\DebuggingAids.cs" />
<Compile Include="StackExchange\Redis\EndPointCollection.cs" />
<Compile Include="StackExchange\Redis\EndPointEventArgs.cs" />
<Compile Include="StackExchange\Redis\ExceptionFactory.cs" />
<Compile Include="StackExchange\Redis\Exclude.cs" />
<Compile Include="StackExchange\Redis\ExportOptions.cs" />
<Compile Include="StackExchange\Redis\Format.cs" />
<Compile Include="StackExchange\Redis\HashSlotMovedEventArgs.cs" />
<Compile Include="StackExchange\Redis\IBatch.cs" />
<Compile Include="StackExchange\Redis\ICompletable.cs" />
<Compile Include="StackExchange\Redis\IDatabase.cs" />
<Compile Include="StackExchange\Redis\IDatabaseAsync.cs" />
<Compile Include="StackExchange\Redis\IMultiMessage.cs" />
<Compile Include="StackExchange\Redis\InternalErrorEventArgs.cs" />
<Compile Include="StackExchange\Redis\IRedis.cs" />
<Compile Include="StackExchange\Redis\IRedisAsync.cs" />
<Compile Include="StackExchange\Redis\IServer.cs" />
<Compile Include="StackExchange\Redis\ISubscriber.cs" />
<Compile Include="StackExchange\Redis\ITransaction.cs" />
<Compile Include="StackExchange\Redis\LoggingTextStream.cs" />
<Compile Include="StackExchange\Redis\Message.cs" />
<Compile Include="StackExchange\Redis\MessageCompletable.cs" />
<Compile Include="StackExchange\Redis\MessageQueue.cs" />
<Compile Include="StackExchange\Redis\Order.cs" />
<Compile Include="StackExchange\Redis\PhysicalBridge.cs" />
<Compile Include="StackExchange\Redis\PhysicalConnection.cs" />
<Compile Include="StackExchange\Redis\RawResult.cs" />
<Compile Include="StackExchange\Redis\RedisBase.cs" />
<Compile Include="StackExchange\Redis\RedisBatch.cs" />
<Compile Include="StackExchange\Redis\RedisChannel.cs" />
<Compile Include="StackExchange\Redis\RedisCommand.cs" />
<Compile Include="StackExchange\Redis\RedisDatabase.cs" />
<Compile Include="StackExchange\Redis\RedisErrorEventArgs.cs" />
<Compile Include="StackExchange\Redis\RedisFeatures.cs" />
<Compile Include="StackExchange\Redis\RedisKey.cs" />
<Compile Include="StackExchange\Redis\RedisLiterals.cs" />
<Compile Include="StackExchange\Redis\RedisResult.cs" />
<Compile Include="StackExchange\Redis\RedisServer.cs" />
<Compile Include="StackExchange\Redis\RedisSubscriber.cs" />
<Compile Include="StackExchange\Redis\RedisTransaction.cs" />
<Compile Include="StackExchange\Redis\RedisType.cs" />
<Compile Include="StackExchange\Redis\RedisValue.cs" />
<Compile Include="StackExchange\Redis\ReplicationChangeOptions.cs" />
<Compile Include="StackExchange\Redis\ResultBox.cs" />
<Compile Include="StackExchange\Redis\ResultProcessor.cs" />
<Compile Include="StackExchange\Redis\ResultType.cs" />
<Compile Include="StackExchange\Redis\SaveType.cs" />
<Compile Include="StackExchange\Redis\ServerCounters.cs" />
<Compile Include="StackExchange\Redis\ServerEndPoint.cs" />
<Compile Include="StackExchange\Redis\ServerSelectionStrategy.cs" />
<Compile Include="StackExchange\Redis\ServerType.cs" />
<Compile Include="StackExchange\Redis\SetOperation.cs" />
<Compile Include="StackExchange\Redis\ShutdownMode.cs" />
<Compile Include="StackExchange\Redis\SocketManager.cs" />
<Compile Include="StackExchange\Redis\SortType.cs" />
<Compile Include="StackExchange\Redis\StringSplits.cs" />
<Compile Include="StackExchange\Redis\TaskSource.cs" />
<Compile Include="StackExchange\Redis\When.cs" />
<Compile Include="StackExchange\Redis\HashEntry.cs" />
<Compile Include="StackExchange\Redis\ExtensionMethods.cs" />
<Compile Include="StackExchange\Redis\SocketManager.NoPoll.cs" />
<Compile Include="StackExchange\Redis\SocketManager.Poll.cs" />
<Compile Include="StackExchange\Redis\SortedSetEntry.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup>
<Folder Include="StackExchange\Redis\" />
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="14.0.24720" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.24720</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>86526b5c-1163-4481-a5e2-a303a0bb1535</ProjectGuid> <ProjectGuid>ef84877f-59be-41be-9013-e765af0bb72e</ProjectGuid>
<RootNamespace>StackExchange.Redis</RootNamespace> <RootNamespace>StackExchange.Redis</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath> <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath> <OutputPath Condition="'$(OutputPath)'=='' ">..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project> </Project>
\ No newline at end of file
...@@ -172,6 +172,7 @@ public sealed class ClusterConfiguration ...@@ -172,6 +172,7 @@ public sealed class ClusterConfiguration
private readonly ServerSelectionStrategy serverSelectionStrategy; private readonly ServerSelectionStrategy serverSelectionStrategy;
internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, string nodes, EndPoint origin) internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, string nodes, EndPoint origin)
{ {
// Beware: Any exception thrown here will wreak silent havoc like inability to connect to cluster nodes or non returning calls
this.serverSelectionStrategy = serverSelectionStrategy; this.serverSelectionStrategy = serverSelectionStrategy;
this.origin = origin; this.origin = origin;
using (var reader = new StringReader(nodes)) using (var reader = new StringReader(nodes))
...@@ -180,9 +181,36 @@ internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, s ...@@ -180,9 +181,36 @@ internal ClusterConfiguration(ServerSelectionStrategy serverSelectionStrategy, s
while ((line = reader.ReadLine()) != null) while ((line = reader.ReadLine()) != null)
{ {
if (string.IsNullOrWhiteSpace(line)) continue; if (string.IsNullOrWhiteSpace(line)) continue;
var node = new ClusterNode(this, line, origin); var node = new ClusterNode(this, line, origin);
nodeLookup.Add(node.EndPoint, node); // Be resilient to ":0 {master,slave},fail,noaddr" nodes
if (node.IsNoAddr)
continue;
if (nodeLookup.ContainsKey(node.EndPoint))
{
// Deal with conflicting node entries for the same endpoint
// This can happen in dynamic environments when a node goes down and a new one is created
// to replace it.
if (!node.IsConnected)
{
// The node we're trying to add is probably about to become stale. Ignore it.
continue;
}
else if (!nodeLookup[node.EndPoint].IsConnected)
{
// The node we registered previously is probably stale. Replace it with a known good node.
nodeLookup[node.EndPoint] = node;
}
else
{
// We have conflicting connected nodes. There's nothing much we can do other than
// wait for the cluster state to converge and refresh on the next pass.
// The same is true if we have multiple disconnected nodes.
}
}
else
{
nodeLookup.Add(node.EndPoint, node);
}
} }
} }
} }
...@@ -262,6 +290,10 @@ public sealed class ClusterNode : IEquatable<ClusterNode>, IComparable<ClusterN ...@@ -262,6 +290,10 @@ public sealed class ClusterNode : IEquatable<ClusterNode>, IComparable<ClusterN
private readonly bool isSlave; private readonly bool isSlave;
private readonly bool isNoAddr;
private readonly bool isConnected;
private readonly string nodeId, parentNodeId, raw; private readonly string nodeId, parentNodeId, raw;
private readonly IList<SlotRange> slots; private readonly IList<SlotRange> slots;
...@@ -275,22 +307,18 @@ public sealed class ClusterNode : IEquatable<ClusterNode>, IComparable<ClusterN ...@@ -275,22 +307,18 @@ public sealed class ClusterNode : IEquatable<ClusterNode>, IComparable<ClusterN
internal ClusterNode() { } internal ClusterNode() { }
internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint origin) internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint origin)
{ {
// http://redis.io/commands/cluster-nodes
this.configuration = configuration; this.configuration = configuration;
this.raw = raw; this.raw = raw;
var parts = raw.Split(StringSplits.Space); var parts = raw.Split(StringSplits.Space);
var flags = parts[2].Split(StringSplits.Comma); var flags = parts[2].Split(StringSplits.Comma);
if (flags.Contains("myself")) endpoint = Format.TryParseEndPoint(parts[1]);
{
endpoint = origin;
}
else
{
endpoint = Format.TryParseEndPoint(parts[1]);
}
nodeId = parts[0]; nodeId = parts[0];
isSlave = flags.Contains("slave"); isSlave = flags.Contains("slave");
isNoAddr = flags.Contains("noaddr");
parentNodeId = string.IsNullOrWhiteSpace(parts[3]) ? null : parts[3]; parentNodeId = string.IsNullOrWhiteSpace(parts[3]) ? null : parts[3];
List<SlotRange> slots = null; List<SlotRange> slots = null;
...@@ -305,6 +333,7 @@ internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint or ...@@ -305,6 +333,7 @@ internal ClusterNode(ClusterConfiguration configuration, string raw, EndPoint or
} }
} }
this.slots = slots == null ? NoSlots : slots.AsReadOnly(); this.slots = slots == null ? NoSlots : slots.AsReadOnly();
this.isConnected = parts[7] == "connected"; // Can be "connected" or "disconnected"
} }
/// <summary> /// <summary>
/// Gets all child nodes of the current node /// Gets all child nodes of the current node
...@@ -339,6 +368,16 @@ public IList<ClusterNode> Children ...@@ -339,6 +368,16 @@ public IList<ClusterNode> Children
/// </summary> /// </summary>
public bool IsSlave { get { return isSlave; } } public bool IsSlave { get { return isSlave; } }
/// <summary>
/// Gets whether this node is flagged as noaddr
/// </summary>
public bool IsNoAddr { get { return isNoAddr; } }
/// <summary>
/// Gets the node's connection status
/// </summary>
public bool IsConnected { get { return isConnected; } }
/// <summary> /// <summary>
/// Gets the unique node-id of the current node /// Gets the unique node-id of the current node
/// </summary> /// </summary>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StackExchange.Redis
{
/// <summary>
/// Helper for Array.ConvertAll() as it's missing on .Net Core.
/// </summary>
public static class ConvertHelper
{
/// <summary>
/// Converts array of one type to an array of another type.
/// </summary>
/// <typeparam name="TInput">Input type</typeparam>
/// <typeparam name="TOutput">Output type</typeparam>
/// <param name="source">source</param>
/// <param name="selector">selector</param>
/// <returns></returns>
public static TOutput[] ConvertAll<TInput, TOutput>(TInput[] source, Func<TInput, TOutput> selector)
{
#if CORE_CLR
TOutput[] arr = new TOutput[source.Length];
for(int i = 0 ; i < arr.Length ; i++)
arr[i] = selector(source[i]);
return arr;
#else
return Array.ConvertAll(source, item => selector(item));
#endif
}
}
}
...@@ -10,7 +10,7 @@ internal static class VolatileWrapper ...@@ -10,7 +10,7 @@ internal static class VolatileWrapper
{ {
public static int Read(ref int location) public static int Read(ref int location)
{ {
#if !DNXCORE50 #if !CORE_CLR
return System.Threading.Thread.VolatileRead(ref location); return System.Threading.Thread.VolatileRead(ref location);
#else #else
return System.Threading.Volatile.Read(ref location); return System.Threading.Volatile.Read(ref location);
...@@ -19,7 +19,7 @@ public static int Read(ref int location) ...@@ -19,7 +19,7 @@ public static int Read(ref int location)
public static void Write(ref int address, int value) public static void Write(ref int address, int value)
{ {
#if !DNXCORE50 #if !CORE_CLR
System.Threading.Thread.VolatileWrite(ref address, value); System.Threading.Thread.VolatileWrite(ref address, value);
#else #else
System.Threading.Volatile.Write(ref address, value); System.Threading.Volatile.Write(ref address, value);
......
...@@ -30,7 +30,7 @@ public enum Proxy ...@@ -30,7 +30,7 @@ public enum Proxy
/// The options relevant to a set of redis connections /// The options relevant to a set of redis connections
/// </summary> /// </summary>
public sealed class ConfigurationOptions public sealed class ConfigurationOptions
#if !DNXCORE50 #if !CORE_CLR
: ICloneable : ICloneable
#endif #endif
{ {
...@@ -143,7 +143,7 @@ public static string TryNormalize(string value) ...@@ -143,7 +143,7 @@ public static string TryNormalize(string value)
/// Indicates whether the connection should be encrypted /// Indicates whether the connection should be encrypted
/// </summary> /// </summary>
[Obsolete("Please use .Ssl instead of .UseSsl"), [Obsolete("Please use .Ssl instead of .UseSsl"),
#if !DNXCORE50 #if !CORE_CLR
Browsable(false), Browsable(false),
#endif #endif
EditorBrowsable(EditorBrowsableState.Never)] EditorBrowsable(EditorBrowsableState.Never)]
...@@ -470,7 +470,7 @@ static void Append(StringBuilder sb, string prefix, object value) ...@@ -470,7 +470,7 @@ static void Append(StringBuilder sb, string prefix, object value)
} }
} }
#if !DNXCORE50 #if !CORE_CLR
static bool IsOption(string option, string prefix) static bool IsOption(string option, string prefix)
{ {
return option.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase); return option.StartsWith(prefix, StringComparison.InvariantCultureIgnoreCase);
...@@ -492,7 +492,7 @@ void Clear() ...@@ -492,7 +492,7 @@ void Clear()
SocketManager = null; SocketManager = null;
} }
#if !DNXCORE50 #if !CORE_CLR
object ICloneable.Clone() { return Clone(); } object ICloneable.Clone() { return Clone(); }
#endif #endif
......
...@@ -299,9 +299,10 @@ public enum CompletionType ...@@ -299,9 +299,10 @@ public enum CompletionType
/// </summary> /// </summary>
Async = 2 Async = 2
} }
#if !CORE_CLR
internal class CompletionTypeHelper internal class CompletionTypeHelper
{ {
public static void RunWithCompletionType(Func<AsyncCallback, IAsyncResult> beginAsync, AsyncCallback callback, CompletionType completionType) public static void RunWithCompletionType(Func<AsyncCallback, IAsyncResult> beginAsync, AsyncCallback callback, CompletionType completionType)
{ {
AsyncCallback proxyCallback; AsyncCallback proxyCallback;
...@@ -343,6 +344,7 @@ public static void RunWithCompletionType(Func<AsyncCallback, IAsyncResult> begin ...@@ -343,6 +344,7 @@ public static void RunWithCompletionType(Func<AsyncCallback, IAsyncResult> begin
return; return;
} }
} }
#endif
#if VERBOSE #if VERBOSE
......
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Net; using System.Net;
...@@ -9,6 +10,14 @@ namespace StackExchange.Redis ...@@ -9,6 +10,14 @@ namespace StackExchange.Redis
/// </summary> /// </summary>
public sealed class EndPointCollection : Collection<EndPoint> public sealed class EndPointCollection : Collection<EndPoint>
{ {
public EndPointCollection() : base()
{
}
public EndPointCollection(IList<EndPoint> endpoints) : base(endpoints)
{
}
/// <summary> /// <summary>
/// Format an endpoint /// Format an endpoint
/// </summary> /// </summary>
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace StackExchange.Redis
namespace StackExchange.Redis {
{ /// <summary>
/// <summary> /// Utility methods
/// Utility methods /// </summary>
/// </summary> public static class ExtensionMethods
public static class ExtensionMethods {
{ /// <summary>
/// <summary> /// Create a dictionary from an array of HashEntry values
/// Create a dictionary from an array of HashEntry values /// </summary>
/// </summary> public static Dictionary<string,string> ToStringDictionary(this HashEntry[] hash)
public static Dictionary<string,string> ToStringDictionary(this HashEntry[] hash) {
{ if (hash == null) return null;
if (hash == null) return null;
var result = new Dictionary<string, string>(hash.Length, StringComparer.Ordinal);
var result = new Dictionary<string, string>(hash.Length, StringComparer.Ordinal); for(int i = 0; i < hash.Length; i++)
for(int i = 0; i < hash.Length; i++) {
{ result.Add(hash[i].name, hash[i].value);
result.Add(hash[i].name, hash[i].value); }
} return result;
return result; }
} /// <summary>
/// <summary> /// Create a dictionary from an array of HashEntry values
/// Create a dictionary from an array of HashEntry values /// </summary>
/// </summary> public static Dictionary<RedisValue, RedisValue> ToDictionary(this HashEntry[] hash)
public static Dictionary<RedisValue, RedisValue> ToDictionary(this HashEntry[] hash) {
{ if (hash == null) return null;
if (hash == null) return null;
var result = new Dictionary<RedisValue, RedisValue>(hash.Length);
var result = new Dictionary<RedisValue, RedisValue>(hash.Length); for (int i = 0; i < hash.Length; i++)
for (int i = 0; i < hash.Length; i++) {
{ result.Add(hash[i].name, hash[i].value);
result.Add(hash[i].name, hash[i].value); }
} return result;
return result; }
}
/// <summary>
/// <summary> /// Create a dictionary from an array of SortedSetEntry values
/// Create a dictionary from an array of SortedSetEntry values /// </summary>
/// </summary> public static Dictionary<string, double> ToStringDictionary(this SortedSetEntry[] sortedSet)
public static Dictionary<string, double> ToStringDictionary(this SortedSetEntry[] sortedSet) {
{ if (sortedSet == null) return null;
if (sortedSet == null) return null;
var result = new Dictionary<string, double>(sortedSet.Length, StringComparer.Ordinal);
var result = new Dictionary<string, double>(sortedSet.Length, StringComparer.Ordinal); for (int i = 0; i < sortedSet.Length; i++)
for (int i = 0; i < sortedSet.Length; i++) {
{ result.Add(sortedSet[i].element, sortedSet[i].score);
result.Add(sortedSet[i].element, sortedSet[i].score); }
} return result;
return result; }
}
/// <summary>
/// <summary> /// Create a dictionary from an array of SortedSetEntry values
/// Create a dictionary from an array of SortedSetEntry values /// </summary>
/// </summary> public static Dictionary<RedisValue, double> ToDictionary(this SortedSetEntry[] sortedSet)
public static Dictionary<RedisValue, double> ToDictionary(this SortedSetEntry[] sortedSet) {
{ if (sortedSet == null) return null;
if (sortedSet == null) return null;
var result = new Dictionary<RedisValue, double>(sortedSet.Length);
var result = new Dictionary<RedisValue, double>(sortedSet.Length); for (int i = 0; i < sortedSet.Length; i++)
for (int i = 0; i < sortedSet.Length; i++) {
{ result.Add(sortedSet[i].element, sortedSet[i].score);
result.Add(sortedSet[i].element, sortedSet[i].score); }
} return result;
return result; }
}
/// <summary>
/// <summary> /// Create a dictionary from an array of key/value pairs
/// Create a dictionary from an array of key/value pairs /// </summary>
/// </summary> public static Dictionary<string, string> ToStringDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs)
public static Dictionary<string, string> ToStringDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs) {
{ if (pairs == null) return null;
if (pairs == null) return null;
var result = new Dictionary<string, string>(pairs.Length, StringComparer.Ordinal);
var result = new Dictionary<string, string>(pairs.Length, StringComparer.Ordinal); for (int i = 0; i < pairs.Length; i++)
for (int i = 0; i < pairs.Length; i++) {
{ result.Add(pairs[i].Key, pairs[i].Value);
result.Add(pairs[i].Key, pairs[i].Value); }
} return result;
return result; }
}
/// <summary>
/// <summary> /// Create a dictionary from an array of key/value pairs
/// Create a dictionary from an array of key/value pairs /// </summary>
/// </summary> public static Dictionary<RedisKey, RedisValue> ToDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs)
public static Dictionary<RedisKey, RedisValue> ToDictionary(this KeyValuePair<RedisKey, RedisValue>[] pairs) {
{ if (pairs == null) return null;
if (pairs == null) return null;
var result = new Dictionary<RedisKey, RedisValue>(pairs.Length);
var result = new Dictionary<RedisKey, RedisValue>(pairs.Length); for (int i = 0; i < pairs.Length; i++)
for (int i = 0; i < pairs.Length; i++) {
{ result.Add(pairs[i].Key, pairs[i].Value);
result.Add(pairs[i].Key, pairs[i].Value); }
} return result;
return result; }
}
/// <summary>
/// <summary> /// Create a dictionary from an array of string pairs
/// Create a dictionary from an array of string pairs /// </summary>
/// </summary> public static Dictionary<string, string> ToDictionary(this KeyValuePair<string, string>[] pairs)
public static Dictionary<string, string> ToDictionary(this KeyValuePair<string, string>[] pairs) {
{ if (pairs == null) return null;
if (pairs == null) return null;
var result = new Dictionary<string, string>(pairs.Length, StringComparer.Ordinal);
var result = new Dictionary<string, string>(pairs.Length, StringComparer.Ordinal); for (int i = 0; i < pairs.Length; i++)
for (int i = 0; i < pairs.Length; i++) {
{ result.Add(pairs[i].Key, pairs[i].Value);
result.Add(pairs[i].Key, pairs[i].Value); }
} return result;
return result; }
}
static readonly string[] nix = new string[0];
static readonly string[] nix = new string[0]; /// <summary>
/// <summary> /// Create an array of strings from an array of values
/// Create an array of strings from an array of values /// </summary>
/// </summary> public static string[] ToStringArray(this RedisValue[] values)
public static string[] ToStringArray(this RedisValue[] values) {
{ if (values == null) return null;
if (values == null) return null; if (values.Length == 0) return nix;
if (values.Length == 0) return nix; return ConvertHelper.ConvertAll(values, x => (string)x);
return values.Select(x => (string)x).ToArray(); }
} }
} }
}
...@@ -133,7 +133,7 @@ internal static bool TryGetHostPort(EndPoint endpoint, out string host, out int ...@@ -133,7 +133,7 @@ internal static bool TryGetHostPort(EndPoint endpoint, out string host, out int
internal static bool TryParseDouble(string s, out double value) internal static bool TryParseDouble(string s, out double value)
{ {
if(s == null || s.Length == 0) if(string.IsNullOrEmpty(s))
{ {
value = 0; value = 0;
return false; return false;
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
namespace StackExchange.Redis namespace StackExchange.Redis
{ {
/// <summary> /// <summary>
/// Describes a hash-field (a name/value pair) /// Describes a hash-field (a name/value pair)
/// </summary> /// </summary>
public struct HashEntry : IEquatable<HashEntry> public struct HashEntry : IEquatable<HashEntry>
{ {
internal readonly RedisValue name, value; internal readonly RedisValue name, value;
/// <summary> /// <summary>
/// Initializes a HashEntry value /// Initializes a HashEntry value
/// </summary> /// </summary>
public HashEntry(RedisValue name, RedisValue value) public HashEntry(RedisValue name, RedisValue value)
{ {
this.name = name; this.name = name;
this.value = value; this.value = value;
} }
/// <summary> /// <summary>
/// The name of the hash field /// The name of the hash field
/// </summary> /// </summary>
public RedisValue Name { get { return name; } } public RedisValue Name { get { return name; } }
/// <summary> /// <summary>
/// The value of the hash field /// The value of the hash field
/// </summary> /// </summary>
public RedisValue Value{ get { return value; } } public RedisValue Value{ get { return value; } }
/// <summary> /// <summary>
/// The name of the hash field /// The name of the hash field
/// </summary> /// </summary>
#if !DNXCORE50 #if !CORE_CLR
[Browsable(false)] [Browsable(false)]
#endif #endif
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Name", false)] [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Name", false)]
public RedisValue Key { get { return name; } } public RedisValue Key { get { return name; } }
/// <summary> /// <summary>
/// Converts to a key/value pair /// Converts to a key/value pair
/// </summary> /// </summary>
public static implicit operator KeyValuePair<RedisValue, RedisValue>(HashEntry value) public static implicit operator KeyValuePair<RedisValue, RedisValue>(HashEntry value)
{ {
return new KeyValuePair<RedisValue, RedisValue>(value.name, value.value); return new KeyValuePair<RedisValue, RedisValue>(value.name, value.value);
} }
/// <summary> /// <summary>
/// Converts from a key/value pair /// Converts from a key/value pair
/// </summary> /// </summary>
public static implicit operator HashEntry(KeyValuePair<RedisValue, RedisValue> value) public static implicit operator HashEntry(KeyValuePair<RedisValue, RedisValue> value)
{ {
return new HashEntry(value.Key, value.Value); return new HashEntry(value.Key, value.Value);
} }
/// <summary> /// <summary>
/// See Object.ToString() /// See Object.ToString()
/// </summary> /// </summary>
public override string ToString() public override string ToString()
{ {
return name + ": " + value; return name + ": " + value;
} }
/// <summary> /// <summary>
/// See Object.GetHashCode() /// See Object.GetHashCode()
/// </summary> /// </summary>
public override int GetHashCode() public override int GetHashCode()
{ {
return name.GetHashCode() ^ value.GetHashCode(); return name.GetHashCode() ^ value.GetHashCode();
} }
/// <summary> /// <summary>
/// Compares two values for equality /// Compares two values for equality
/// </summary> /// </summary>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return obj is HashEntry && Equals((HashEntry)obj); return obj is HashEntry && Equals((HashEntry)obj);
} }
/// <summary> /// <summary>
/// Compares two values for equality /// Compares two values for equality
/// </summary> /// </summary>
public bool Equals(HashEntry value) public bool Equals(HashEntry value)
{ {
return this.name == value.name && this.value == value.value; return this.name == value.name && this.value == value.value;
} }
/// <summary> /// <summary>
/// Compares two values for equality /// Compares two values for equality
/// </summary> /// </summary>
public static bool operator ==(HashEntry x, HashEntry y) public static bool operator ==(HashEntry x, HashEntry y)
{ {
return x.name == y.name && x.value == y.value; return x.name == y.name && x.value == y.value;
} }
/// <summary> /// <summary>
/// Compares two values for non-equality /// Compares two values for non-equality
/// </summary> /// </summary>
public static bool operator !=(HashEntry x, HashEntry y) public static bool operator !=(HashEntry x, HashEntry y)
{ {
return x.name != y.name || x.value != y.value; return x.name != y.name || x.value != y.value;
} }
} }
} }
#if DNXCORE50 using System;
using System;
#endif
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace StackExchange.Redis namespace StackExchange.Redis
{ {
/// <summary>
/// Credits to Sam Harwell https://github.com/dotnet/corefx/issues/340#issuecomment-120749951
/// </summary>
internal static class InternalRegexCompiledOption internal static class InternalRegexCompiledOption
{ {
private static readonly RegexOptions RegexCompiledOption; private static readonly RegexOptions RegexCompiledOption;
static InternalRegexCompiledOption() static InternalRegexCompiledOption()
{ {
#if DNXCORE50 #if CORE_CLR
if (!Enum.TryParse("Compiled", out RegexCompiledOption)) if (!Enum.TryParse("Compiled", out RegexCompiledOption))
RegexCompiledOption = RegexOptions.None; RegexCompiledOption = RegexOptions.None;
#else #else
......
...@@ -335,12 +335,12 @@ public Task<RedisResult> ScriptEvaluateAsync(string script, RedisKey[] keys = nu ...@@ -335,12 +335,12 @@ public Task<RedisResult> ScriptEvaluateAsync(string script, RedisKey[] keys = nu
public Task<RedisResult> ScriptEvaluateAsync(LuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) public Task<RedisResult> ScriptEvaluateAsync(LuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None)
{ {
throw new NotImplementedException(); return this.Inner.ScriptEvaluateAsync(script, parameters, flags);
} }
public Task<RedisResult> ScriptEvaluateAsync(LoadedLuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None) public Task<RedisResult> ScriptEvaluateAsync(LoadedLuaScript script, object parameters = null, CommandFlags flags = CommandFlags.None)
{ {
throw new NotImplementedException(); return this.Inner.ScriptEvaluateAsync(script, parameters, flags);
} }
public Task<long> SetAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) public Task<long> SetAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
#if DNXCORE50 #if CORE_CLR
using System.Threading.Tasks; using System.Threading.Tasks;
#endif #endif
...@@ -131,7 +131,7 @@ public void Dispose() ...@@ -131,7 +131,7 @@ public void Dispose()
if (outStream != null) if (outStream != null)
{ {
multiplexer.Trace("Disconnecting...", physicalName); multiplexer.Trace("Disconnecting...", physicalName);
#if !DNXCORE50 #if !CORE_CLR
try { outStream.Close(); } catch { } try { outStream.Close(); } catch { }
#endif #endif
try { outStream.Dispose(); } catch { } try { outStream.Dispose(); } catch { }
...@@ -139,7 +139,7 @@ public void Dispose() ...@@ -139,7 +139,7 @@ public void Dispose()
} }
if (netStream != null) if (netStream != null)
{ {
#if !DNXCORE50 #if !CORE_CLR
try { netStream.Close(); } catch { } try { netStream.Close(); } catch { }
#endif #endif
try { netStream.Dispose(); } catch { } try { netStream.Dispose(); } catch { }
...@@ -603,6 +603,22 @@ unsafe void WriteRaw(Stream stream, string value, int encodedLength) ...@@ -603,6 +603,22 @@ unsafe void WriteRaw(Stream stream, string value, int encodedLength)
} }
else else
{ {
#if !CORE_CLR
fixed (char* c = value)
fixed (byte* b = outScratch)
{
int charsRemaining = value.Length, charOffset = 0, bytesWritten;
while (charsRemaining > Scratch_CharsPerBlock)
{
bytesWritten = outEncoder.GetBytes(c + charOffset, Scratch_CharsPerBlock, b, ScratchSize, false);
stream.Write(outScratch, 0, bytesWritten);
charOffset += Scratch_CharsPerBlock;
charsRemaining -= Scratch_CharsPerBlock;
}
bytesWritten = outEncoder.GetBytes(c + charOffset, charsRemaining, b, ScratchSize, true);
if (bytesWritten != 0) stream.Write(outScratch, 0, bytesWritten);
}
#else
int charsRemaining = value.Length, charOffset = 0, bytesWritten; int charsRemaining = value.Length, charOffset = 0, bytesWritten;
var valueCharArray = value.ToCharArray(); var valueCharArray = value.ToCharArray();
while (charsRemaining > Scratch_CharsPerBlock) while (charsRemaining > Scratch_CharsPerBlock)
...@@ -614,6 +630,7 @@ unsafe void WriteRaw(Stream stream, string value, int encodedLength) ...@@ -614,6 +630,7 @@ unsafe void WriteRaw(Stream stream, string value, int encodedLength)
} }
bytesWritten = outEncoder.GetBytes(valueCharArray, charOffset, charsRemaining, outScratch, 0, true); bytesWritten = outEncoder.GetBytes(valueCharArray, charOffset, charsRemaining, outScratch, 0, true);
if (bytesWritten != 0) stream.Write(outScratch, 0, bytesWritten); if (bytesWritten != 0) stream.Write(outScratch, 0, bytesWritten);
#endif
} }
} }
const int ScratchSize = 512; const int ScratchSize = 512;
...@@ -661,7 +678,7 @@ void BeginReading() ...@@ -661,7 +678,7 @@ void BeginReading()
int space = EnsureSpaceAndComputeBytesToRead(); int space = EnsureSpaceAndComputeBytesToRead();
multiplexer.Trace("Beginning async read...", physicalName); multiplexer.Trace("Beginning async read...", physicalName);
var result = netStream.BeginRead(ioBuffer, ioBufferBytes, space, endRead, this); var result = netStream.BeginRead(ioBuffer, ioBufferBytes, space, endRead, this);
#if DNXCORE50 #if CORE_CLR
Task<int> t = (Task<int>)result; Task<int> t = (Task<int>)result;
if (t.Status == TaskStatus.RanToCompletion && t.Result == -1) if (t.Status == TaskStatus.RanToCompletion && t.Result == -1)
{ {
...@@ -676,7 +693,7 @@ void BeginReading() ...@@ -676,7 +693,7 @@ void BeginReading()
} }
} while (keepReading); } while (keepReading);
} }
#if DNXCORE50 #if CORE_CLR
catch (AggregateException ex) catch (AggregateException ex)
{ {
throw ex.InnerException; throw ex.InnerException;
...@@ -759,7 +776,7 @@ SocketMode ISocketCallback.Connected(Stream stream, TextWriter log) ...@@ -759,7 +776,7 @@ SocketMode ISocketCallback.Connected(Stream stream, TextWriter log)
int bufferSize = config.WriteBuffer; int bufferSize = config.WriteBuffer;
this.netStream = stream; this.netStream = stream;
#if !DNXCORE50 #if !CORE_CLR
this.outStream = bufferSize <= 0 ? stream : new BufferedStream(stream, bufferSize); this.outStream = bufferSize <= 0 ? stream : new BufferedStream(stream, bufferSize);
#else #else
this.outStream = stream; this.outStream = stream;
...@@ -1096,7 +1113,7 @@ public void CheckForStaleConnection(ref SocketManager.ManagerState managerState) ...@@ -1096,7 +1113,7 @@ public void CheckForStaleConnection(ref SocketManager.ManagerState managerState)
} }
} }
#if DNXCORE50 #if CORE_CLR
internal static class StreamExtensions internal static class StreamExtensions
{ {
internal static IAsyncResult BeginRead(this Stream stream, byte[] buffer, int offset, int count, AsyncCallback ac, object state) internal static IAsyncResult BeginRead(this Stream stream, byte[] buffer, int offset, int count, AsyncCallback ac, object state)
......
...@@ -484,7 +484,7 @@ sealed class KeyMigrateCommandMessage : Message.CommandKeyBase // MIGRATE is aty ...@@ -484,7 +484,7 @@ sealed class KeyMigrateCommandMessage : Message.CommandKeyBase // MIGRATE is aty
public KeyMigrateCommandMessage(int db, RedisKey key, EndPoint toServer, int toDatabase, int timeoutMilliseconds, MigrateOptions migrateOptions, CommandFlags flags) public KeyMigrateCommandMessage(int db, RedisKey key, EndPoint toServer, int toDatabase, int timeoutMilliseconds, MigrateOptions migrateOptions, CommandFlags flags)
: base(db, flags, RedisCommand.MIGRATE, key) : base(db, flags, RedisCommand.MIGRATE, key)
{ {
if (toServer == null) throw new ArgumentNullException("server"); if (toServer == null) throw new ArgumentNullException("toServer");
string toHost; string toHost;
int toPort; int toPort;
if (!Format.TryGetHostPort(toServer, out toHost, out toPort)) throw new ArgumentException("toServer"); if (!Format.TryGetHostPort(toServer, out toHost, out toPort)) throw new ArgumentException("toServer");
......
using System; using System;
#if DNXCORE50 #if CORE_CLR
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
#endif #endif
...@@ -306,11 +306,11 @@ public int CompareTo(RedisValue other) ...@@ -306,11 +306,11 @@ public int CompareTo(RedisValue other)
if (otherType == CompareType.Double) return thisDouble.CompareTo(otherDouble); if (otherType == CompareType.Double) return thisDouble.CompareTo(otherDouble);
} }
// otherwise, compare as strings // otherwise, compare as strings
#if !DNXCORE50 #if !CORE_CLR
return StringComparer.InvariantCulture.Compare((string)this, (string)other); return StringComparer.InvariantCulture.Compare((string)this, (string)other);
#else #else
var compareInfo = System.Globalization.CultureInfo.InvariantCulture.CompareInfo; var compareInfo = System.Globalization.CultureInfo.InvariantCulture.CompareInfo;
return compareInfo.Compare((string)this, (string)other, System.Globalization.CompareOptions.IgnoreCase); return compareInfo.Compare((string)this, (string)other, System.Globalization.CompareOptions.Ordinal);
#endif #endif
} }
catch(Exception ex) catch(Exception ex)
...@@ -716,7 +716,7 @@ public bool TryParse(out double val) ...@@ -716,7 +716,7 @@ public bool TryParse(out double val)
internal static class ReflectionExtensions internal static class ReflectionExtensions
{ {
#if DNXCORE50 #if CORE_CLR
internal static TypeCode GetTypeCode(this Type type) internal static TypeCode GetTypeCode(this Type type)
{ {
if (type == null) return TypeCode.Empty; if (type == null) return TypeCode.Empty;
......
...@@ -313,7 +313,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc ...@@ -313,7 +313,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
LocalBuilder redisKeyLoc = null; LocalBuilder redisKeyLoc = null;
var loc = il.DeclareLocal(t); var loc = il.DeclareLocal(t);
il.Emit(OpCodes.Ldarg_0); // object il.Emit(OpCodes.Ldarg_0); // object
#if !DNXCORE50 #if !CORE_CLR
if (t.IsValueType) if (t.IsValueType)
#else #else
if (t.GetTypeInfo().IsValueType) if (t.GetTypeInfo().IsValueType)
...@@ -348,7 +348,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc ...@@ -348,7 +348,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
{ {
il.Emit(OpCodes.Dup); // RedisKey[] RedisKey[] il.Emit(OpCodes.Dup); // RedisKey[] RedisKey[]
il.Emit(OpCodes.Ldc_I4, i); // RedisKey[] RedisKey[] int il.Emit(OpCodes.Ldc_I4, i); // RedisKey[] RedisKey[] int
#if !DNXCORE50 #if !CORE_CLR
if (t.IsValueType) if (t.IsValueType)
#else #else
if (t.GetTypeInfo().IsValueType) if (t.GetTypeInfo().IsValueType)
...@@ -380,7 +380,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc ...@@ -380,7 +380,7 @@ static void PrefixIfNeeded(ILGenerator il, LocalBuilder needsPrefixBool, ref Loc
{ {
il.Emit(OpCodes.Dup); // RedisKey[] RedisValue[] RedisValue[] il.Emit(OpCodes.Dup); // RedisKey[] RedisValue[] RedisValue[]
il.Emit(OpCodes.Ldc_I4, i); // RedisKey[] RedisValue[] RedisValue[] int il.Emit(OpCodes.Ldc_I4, i); // RedisKey[] RedisValue[] RedisValue[] int
#if !DNXCORE50 #if !CORE_CLR
if (t.IsValueType) if (t.IsValueType)
#else #else
if (t.GetTypeInfo().IsValueType) if (t.GetTypeInfo().IsValueType)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
using System.Net; using System.Net;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
namespace StackExchange.Redis namespace StackExchange.Redis
{ {
...@@ -126,7 +127,7 @@ public SocketManager(string name = null) ...@@ -126,7 +127,7 @@ public SocketManager(string name = null)
// we need a dedicated writer, because when under heavy ambient load // we need a dedicated writer, because when under heavy ambient load
// (a busy asp.net site, for example), workers are not reliable enough // (a busy asp.net site, for example), workers are not reliable enough
#if !DNXCORE50 #if !CORE_CLR
Thread dedicatedWriter = new Thread(writeAllQueues, 32 * 1024); // don't need a huge stack; Thread dedicatedWriter = new Thread(writeAllQueues, 32 * 1024); // don't need a huge stack;
dedicatedWriter.Priority = ThreadPriority.AboveNormal; // time critical dedicatedWriter.Priority = ThreadPriority.AboveNormal; // time critical
#else #else
...@@ -172,37 +173,56 @@ internal SocketToken BeginConnect(EndPoint endpoint, ISocketCallback callback, C ...@@ -172,37 +173,56 @@ internal SocketToken BeginConnect(EndPoint endpoint, ISocketCallback callback, C
this.ShouldForceConnectCompletionType(ref connectCompletionType); this.ShouldForceConnectCompletionType(ref connectCompletionType);
var formattedEndpoint = Format.ToString(endpoint); var formattedEndpoint = Format.ToString(endpoint);
var tuple = Tuple.Create(socket, callback);
if (endpoint is DnsEndPoint) if (endpoint is DnsEndPoint)
{ {
// A work-around for a Mono bug in BeginConnect(EndPoint endpoint, AsyncCallback callback, object state) // A work-around for a Mono bug in BeginConnect(EndPoint endpoint, AsyncCallback callback, object state)
DnsEndPoint dnsEndpoint = (DnsEndPoint)endpoint; DnsEndPoint dnsEndpoint = (DnsEndPoint)endpoint;
#if CORE_CLR
multiplexer.LogLocked(log, "BeginConnect: {0}", formattedEndpoint);
socket.ConnectAsync(dnsEndpoint.Host, dnsEndpoint.Port).ContinueWith(t =>
{
multiplexer.LogLocked(log, "EndConnect: {0}", formattedEndpoint);
EndConnectImpl(t, multiplexer, log, tuple);
multiplexer.LogLocked(log, "Connect complete: {0}", formattedEndpoint);
});
#else
CompletionTypeHelper.RunWithCompletionType( CompletionTypeHelper.RunWithCompletionType(
(cb) => (cb) => {
{
multiplexer.LogLocked(log, "BeginConnect: {0}", formattedEndpoint); multiplexer.LogLocked(log, "BeginConnect: {0}", formattedEndpoint);
return socket.BeginConnect(dnsEndpoint.Host, dnsEndpoint.Port, cb, Tuple.Create(socket, callback)); return socket.BeginConnect(dnsEndpoint.Host, dnsEndpoint.Port, cb, tuple);
}, },
(ar) => (ar) => {
{ multiplexer.LogLocked(log, "EndConnect: {0}", formattedEndpoint);
multiplexer.LogLocked(log, "EndConnect: {0}", formattedEndpoint); EndConnectImpl(ar, multiplexer, log, tuple);
EndConnectImpl(ar, multiplexer, log);
multiplexer.LogLocked(log, "Connect complete: {0}", formattedEndpoint); multiplexer.LogLocked(log, "Connect complete: {0}", formattedEndpoint);
}, },
connectCompletionType); connectCompletionType);
#endif
} }
else else
{ {
#if CORE_CLR
multiplexer.LogLocked(log, "BeginConnect: {0}", formattedEndpoint);
socket.ConnectAsync(endpoint).ContinueWith(t =>
{
multiplexer.LogLocked(log, "EndConnect: {0}", formattedEndpoint);
EndConnectImpl(t, multiplexer, log, tuple);
});
#else
CompletionTypeHelper.RunWithCompletionType( CompletionTypeHelper.RunWithCompletionType(
(cb) => { (cb) => {
multiplexer.LogLocked(log, "BeginConnect: {0}", formattedEndpoint); multiplexer.LogLocked(log, "BeginConnect: {0}", formattedEndpoint);
return socket.BeginConnect(endpoint, cb, Tuple.Create(socket, callback)); return socket.BeginConnect(endpoint, cb, tuple);
}, },
(ar) => { (ar) => {
multiplexer.LogLocked(log, "EndConnect: {0}", formattedEndpoint); multiplexer.LogLocked(log, "EndConnect: {0}", formattedEndpoint);
EndConnectImpl(ar, multiplexer, log); EndConnectImpl(ar, multiplexer, log, tuple);
multiplexer.LogLocked(log, "Connect complete: {0}", formattedEndpoint); multiplexer.LogLocked(log, "Connect complete: {0}", formattedEndpoint);
}, },
connectCompletionType); connectCompletionType);
#endif
} }
} }
catch (NotImplementedException ex) catch (NotImplementedException ex)
...@@ -221,9 +241,9 @@ internal void SetFastLoopbackOption(Socket socket) ...@@ -221,9 +241,9 @@ internal void SetFastLoopbackOption(Socket socket)
// SIO_LOOPBACK_FAST_PATH (http://msdn.microsoft.com/en-us/library/windows/desktop/jj841212%28v=vs.85%29.aspx) // SIO_LOOPBACK_FAST_PATH (http://msdn.microsoft.com/en-us/library/windows/desktop/jj841212%28v=vs.85%29.aspx)
// Speeds up localhost operations significantly. OK to apply to a socket that will not be hooked up to localhost, // Speeds up localhost operations significantly. OK to apply to a socket that will not be hooked up to localhost,
// or will be subject to WFP filtering. // or will be subject to WFP filtering.
#if !DNXCORE50
const int SIO_LOOPBACK_FAST_PATH = -1744830448; const int SIO_LOOPBACK_FAST_PATH = -1744830448;
#if !CORE_CLR
// windows only // windows only
if (Environment.OSVersion.Platform == PlatformID.Win32NT) if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{ {
...@@ -231,8 +251,11 @@ internal void SetFastLoopbackOption(Socket socket) ...@@ -231,8 +251,11 @@ internal void SetFastLoopbackOption(Socket socket)
var osVersion = Environment.OSVersion.Version; var osVersion = Environment.OSVersion.Version;
if (osVersion.Major > 6 || osVersion.Major == 6 && osVersion.Minor >= 2) if (osVersion.Major > 6 || osVersion.Major == 6 && osVersion.Minor >= 2)
{ {
byte[] optionInValue = BitConverter.GetBytes(1); #endif
byte[] optionInValue = BitConverter.GetBytes(1);
socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null); socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null);
#if !CORE_CLR
} }
} }
#endif #endif
...@@ -262,18 +285,20 @@ internal void Shutdown(SocketToken token) ...@@ -262,18 +285,20 @@ internal void Shutdown(SocketToken token)
Shutdown(token.Socket); Shutdown(token.Socket);
} }
private void EndConnectImpl(IAsyncResult ar, ConnectionMultiplexer multiplexer, TextWriter log) private void EndConnectImpl(IAsyncResult ar, ConnectionMultiplexer multiplexer, TextWriter log, Tuple<Socket, ISocketCallback> tuple)
{ {
Tuple<Socket, ISocketCallback> tuple = null;
try try
{ {
tuple = (Tuple<Socket, ISocketCallback>)ar.AsyncState;
bool ignoreConnect = false; bool ignoreConnect = false;
ShouldIgnoreConnect(tuple.Item2, ref ignoreConnect); ShouldIgnoreConnect(tuple.Item2, ref ignoreConnect);
if (ignoreConnect) return; if (ignoreConnect) return;
var socket = tuple.Item1; var socket = tuple.Item1;
var callback = tuple.Item2; var callback = tuple.Item2;
#if CORE_CLR
multiplexer.Wait((Task)ar); // make it explode if invalid (note: already complete at this point)
#else
socket.EndConnect(ar); socket.EndConnect(ar);
#endif
var netStream = new NetworkStream(socket, false); var netStream = new NetworkStream(socket, false);
var socketMode = callback == null ? SocketMode.Abort : callback.Connected(netStream, log); var socketMode = callback == null ? SocketMode.Abort : callback.Connected(netStream, log);
switch (socketMode) switch (socketMode)
...@@ -298,7 +323,7 @@ private void EndConnectImpl(IAsyncResult ar, ConnectionMultiplexer multiplexer, ...@@ -298,7 +323,7 @@ private void EndConnectImpl(IAsyncResult ar, ConnectionMultiplexer multiplexer,
break; break;
} }
} }
catch(ObjectDisposedException) catch (ObjectDisposedException)
{ {
multiplexer.LogLocked(log, "(socket shutdown)"); multiplexer.LogLocked(log, "(socket shutdown)");
if (tuple != null) if (tuple != null)
...@@ -340,7 +365,7 @@ private void Shutdown(Socket socket) ...@@ -340,7 +365,7 @@ private void Shutdown(Socket socket)
{ {
OnShutdown(socket); OnShutdown(socket);
try { socket.Shutdown(SocketShutdown.Both); } catch { } try { socket.Shutdown(SocketShutdown.Both); } catch { }
#if !DNXCORE50 #if !CORE_CLR
try { socket.Close(); } catch { } try { socket.Close(); } catch { }
#endif #endif
try { socket.Dispose(); } catch { } try { socket.Dispose(); } catch { }
......
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
namespace StackExchange.Redis namespace StackExchange.Redis
{ {
/// <summary> /// <summary>
/// Describes a sorted-set element with the corresponding value /// Describes a sorted-set element with the corresponding value
/// </summary> /// </summary>
public struct SortedSetEntry : IEquatable<SortedSetEntry>, IComparable, IComparable<SortedSetEntry> public struct SortedSetEntry : IEquatable<SortedSetEntry>, IComparable, IComparable<SortedSetEntry>
{ {
internal readonly RedisValue element; internal readonly RedisValue element;
internal readonly double score; internal readonly double score;
/// <summary> /// <summary>
/// Initializes a SortedSetEntry value /// Initializes a SortedSetEntry value
/// </summary> /// </summary>
public SortedSetEntry(RedisValue element, double score) public SortedSetEntry(RedisValue element, double score)
{ {
this.element = element; this.element = element;
this.score = score; this.score = score;
} }
/// <summary> /// <summary>
/// The unique element stored in the sorted set /// The unique element stored in the sorted set
/// </summary> /// </summary>
public RedisValue Element { get { return element; } } public RedisValue Element { get { return element; } }
/// <summary> /// <summary>
/// The score against the element /// The score against the element
/// </summary> /// </summary>
public double Score { get { return score; } } public double Score { get { return score; } }
/// <summary> /// <summary>
/// The score against the element /// The score against the element
/// </summary> /// </summary>
#if !DNXCORE50 #if !CORE_CLR
[Browsable(false)] [Browsable(false)]
#endif #endif
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Score", false)] [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Score", false)]
public double Value { get { return score; } } public double Value { get { return score; } }
/// <summary> /// <summary>
/// The unique element stored in the sorted set /// The unique element stored in the sorted set
/// </summary> /// </summary>
#if !DNXCORE50 #if !CORE_CLR
[Browsable(false)] [Browsable(false)]
#endif #endif
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Element", false)] [EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Element", false)]
public RedisValue Key { get { return element; } } public RedisValue Key { get { return element; } }
/// <summary> /// <summary>
/// Converts to a key/value pair /// Converts to a key/value pair
/// </summary> /// </summary>
public static implicit operator KeyValuePair<RedisValue,double>(SortedSetEntry value) public static implicit operator KeyValuePair<RedisValue,double>(SortedSetEntry value)
{ {
return new KeyValuePair<RedisValue, double>(value.element, value.score); return new KeyValuePair<RedisValue, double>(value.element, value.score);
} }
/// <summary> /// <summary>
/// Converts from a key/value pair /// Converts from a key/value pair
/// </summary> /// </summary>
public static implicit operator SortedSetEntry(KeyValuePair<RedisValue, double> value) public static implicit operator SortedSetEntry(KeyValuePair<RedisValue, double> value)
{ {
return new SortedSetEntry(value.Key, value.Value); return new SortedSetEntry(value.Key, value.Value);
} }
/// <summary> /// <summary>
/// See Object.ToString() /// See Object.ToString()
/// </summary> /// </summary>
public override string ToString() public override string ToString()
{ {
return element + ": " + score; return element + ": " + score;
} }
/// <summary> /// <summary>
/// See Object.GetHashCode() /// See Object.GetHashCode()
/// </summary> /// </summary>
public override int GetHashCode() public override int GetHashCode()
{ {
return element.GetHashCode() ^ score.GetHashCode(); return element.GetHashCode() ^ score.GetHashCode();
} }
/// <summary> /// <summary>
/// Compares two values for equality /// Compares two values for equality
/// </summary> /// </summary>
public override bool Equals(object obj) public override bool Equals(object obj)
{ {
return obj is SortedSetEntry && Equals((SortedSetEntry)obj); return obj is SortedSetEntry && Equals((SortedSetEntry)obj);
} }
/// <summary> /// <summary>
/// Compares two values for equality /// Compares two values for equality
/// </summary> /// </summary>
public bool Equals(SortedSetEntry value) public bool Equals(SortedSetEntry value)
{ {
return this.score == value.score && this.element == value.element; return this.score == value.score && this.element == value.element;
} }
/// <summary> /// <summary>
/// Compares two values by score /// Compares two values by score
/// </summary> /// </summary>
public int CompareTo(SortedSetEntry value) public int CompareTo(SortedSetEntry value)
{ {
return this.score.CompareTo(value.score); return this.score.CompareTo(value.score);
} }
/// <summary> /// <summary>
/// Compares two values by score /// Compares two values by score
/// </summary> /// </summary>
public int CompareTo(object value) public int CompareTo(object value)
{ {
return value is SortedSetEntry ? CompareTo((SortedSetEntry)value) : -1; return value is SortedSetEntry ? CompareTo((SortedSetEntry)value) : -1;
} }
/// <summary> /// <summary>
/// Compares two values for equality /// Compares two values for equality
/// </summary> /// </summary>
public static bool operator ==(SortedSetEntry x, SortedSetEntry y) public static bool operator ==(SortedSetEntry x, SortedSetEntry y)
{ {
return x.score == y.score && x.element == y.element; return x.score == y.score && x.element == y.element;
} }
/// <summary> /// <summary>
/// Compares two values for non-equality /// Compares two values for non-equality
/// </summary> /// </summary>
public static bool operator !=(SortedSetEntry x, SortedSetEntry y) public static bool operator !=(SortedSetEntry x, SortedSetEntry y)
{ {
return x.score != y.score || x.element != y.element; return x.score != y.score || x.element != y.element;
} }
} }
} }
Copyright © 2002-2013 Charlie Poole
Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
Copyright © 2000-2002 Philip A. Craig
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.
Portions Copyright © 2002-2013 Charlie Poole or Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\..\StackExchange.Redis.Tests\packages.config" />
</repositories>
\ No newline at end of file
{
"version": "1.1.0-alpha1",
"description": "High performance Redis client, incorporating both synchronous and asynchronous usage.",
"authors": [ "Stack Exchange inc., marc.gravell" ],
"owners": [ "marc.gravell" ],
"tags": [ "Async", "Redis", "Cache", "PubSub", "Messaging" ],
"projectUrl": "https://github.com/StackExchange/StackExchange.Redis",
"licenseUrl": "https://raw.github.com/StackExchange/StackExchange.Redis/master/LICENSE",
"copyright": "Stack Exchange inc. 2014-",
"requireLicenseAcceptance": false,
"summary": "Redis client library",
"dependencies": {
},
"compilationOptions": {
"allowUnsafe": true
},
"frameworks": {
"net40": {
"dependencies": {
"Microsoft.Bcl": "1.1.10",
"Microsoft.Bcl.Async": "1.0.168"
}
},
"net45": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
}
},
"net46": {
"frameworkAssemblies": {
"System.IO.Compression": "4.0.0.0"
},
"define": [ "PLAT_SAFE_CONTINUATIONS" ]
},
"dnxcore50": {
"compilationOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
},
"dependencies": {
"System.Collections.Concurrent": "4.0.11-beta-23516",
"System.Collections.NonGeneric": "4.0.1-beta-23516",
"System.Diagnostics.Debug": "4.0.11-beta-23516",
"System.Diagnostics.Tools": "4.0.1-beta-23516",
"System.Diagnostics.TraceSource": "4.0.0-beta-23516",
"System.Globalization": "4.0.11-beta-23516",
"System.IO": "4.0.11-beta-23516",
"System.IO.Compression": "4.1.0-beta-23516",
"System.IO.FileSystem": "4.0.1-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Net.NameResolution": "4.0.0-beta-23516",
"System.Net.Primitives": "4.0.11-beta-23516",
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.Sockets": "4.1.0-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.Emit": "4.0.1-beta-23516",
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
"System.Text.RegularExpressions": "4.0.11-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Threading.Tasks": "4.0.11-beta-23516",
"System.Threading.Thread": "4.0.0-beta-23516",
"System.Threading.ThreadPool": "4.0.10-beta-23516",
"System.Threading.Timer": "4.0.1-beta-23516"
}
},
"dotnet5.5": {
"compilationOptions": {
"define": [ "PLAT_SAFE_CONTINUATIONS", "CORE_CLR" ]
},
"dependencies": {
"System.Collections.Concurrent": "4.0.11-beta-23516",
"System.Collections.NonGeneric": "4.0.1-beta-23516",
"System.Diagnostics.Debug": "4.0.11-beta-23516",
"System.Diagnostics.Tools": "4.0.1-beta-23516",
"System.Diagnostics.TraceSource": "4.0.0-beta-23516",
"System.Globalization": "4.0.11-beta-23516",
"System.IO": "4.0.11-beta-23516",
"System.IO.Compression": "4.1.0-beta-23516",
"System.IO.FileSystem": "4.0.1-beta-23516",
"System.Linq": "4.0.1-beta-23516",
"System.Net.NameResolution": "4.0.0-beta-23516",
"System.Net.Primitives": "4.0.11-beta-23516",
"System.Net.Security": "4.0.0-beta-23516",
"System.Net.Sockets": "4.1.0-beta-23516",
"System.Reflection": "4.1.0-beta-23516",
"System.Reflection.Emit": "4.0.1-beta-23516",
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
"System.Text.RegularExpressions": "4.0.11-beta-23516",
"System.Threading": "4.0.11-beta-23516",
"System.Threading.Tasks": "4.0.11-beta-23516",
"System.Threading.Thread": "4.0.0-beta-23516",
"System.Threading.ThreadPool": "4.0.10-beta-23516",
"System.Threading.Timer": "4.0.1-beta-23516"
}
}
}
}
\ No newline at end of file
{
"version": "1.1.0-*",
"description": "StackExchange.Redis",
"authors": [ "jeremymeng" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",
"compile": [
"../../StackExchange.Redis/**/*.cs"
],
"dependencies": {
},
"configurations": {
"Debug": {
"compilationOptions": {
"define": [ "DEBUG", "TRACE" ],
"allowUnsafe": true
}
},
"Release": {
"compilationOptions": {
"define": [ "TRACE" ],
"allowUnsafe": true
}
}
},
"frameworks": {
"dnxcore50": {
"dependencies": {
"System.Diagnostics.Debug": "4.0.0",
"System.Diagnostics.TraceSource": "4.0.0-beta-23409",
"System.Diagnostics.Tools": "4.0.0",
"System.IO.Compression": "4.0.0",
"System.Globalization": "4.0.10",
"System.Linq": "4.0.0",
"System.Net.Primitives": "4.0.10",
"System.Net.Sockets": "4.1.0-beta-23409",
"System.Net.Security": "4.0.0-beta-23409",
"System.Net.NameResolution": "4.0.0-beta-23409",
"System.Reflection": "4.0.0",
"System.Reflection.Emit": "4.0.0",
"System.Reflection.TypeExtensions": "4.0.0",
"System.Reflection.Primitives": "4.0.0",
"System.Reflection.Emit.Lightweight": "4.0.0",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23409",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23409",
"System.Text.RegularExpressions": "4.0.10",
"System.Threading": "4.0.0",
"System.Threading.Thread": "4.0.0-*",
"System.Threading.ThreadPool": "4.0.10-beta-23409",
"System.Threading.Timer": "4.0.1-beta-23409",
"System.Threading.Tasks": "4.0.0"
}
}
}
}
\ No newline at end of file
{ {
"sdk": { "sdk": {
"version": "1.0.0-beta8", "version": "1.0.0-rc1-final",
"runtime": "coreclr", "runtime": "coreclr",
"architecture": "x86" "architecture": "x86"
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment