Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
cc7c60f0
Commit
cc7c60f0
authored
Aug 14, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moar fail
parent
167998af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
Parse.cs
StackExchange.Redis.Tests/Parse.cs
+12
-0
Program.cs
TestConsole/Program.cs
+9
-2
No files found.
StackExchange.Redis.Tests/Parse.cs
View file @
cc7c60f0
...
...
@@ -13,8 +13,20 @@ public class Parse : TestBase
public
static
IEnumerable
<
object
[
]>
GetTestData
()
{
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPON"
,
1
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG"
,
1
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r"
,
1
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\n"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nP"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nPO"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nPON"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nPONG"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nPONG\r"
,
2
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nPONG\r\n"
,
3
};
yield
return
new
object
[]
{
"$4\r\nPING\r\n$4\r\nPONG\r\n$4\r\nPONG\r\n$"
,
3
};
}
[
Theory
]
[
MemberData
(
nameof
(
GetTestData
))]
...
...
TestConsole/Program.cs
View file @
cc7c60f0
using
System
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
...
...
@@ -22,7 +23,13 @@ private static void Main()
}
static
ConnectionMultiplexer
Create
()
{
var
muxer
=
ConnectionMultiplexer
.
Connect
(
"localhost:6379"
);
var
options
=
new
ConfigurationOptions
{
EndPoints
=
{
"localhost:6379"
},
SyncTimeout
=
int
.
MaxValue
,
// CommandMap = CommandMap.Create(new HashSet<string> { "subscribe", "psubscsribe", "publish" }, false),
};
var
muxer
=
ConnectionMultiplexer
.
Connect
(
options
);
muxer
.
GetDatabase
().
Ping
();
return
muxer
;
}
...
...
@@ -82,7 +89,7 @@ private static void BatchRunPings(IDatabase db)
var
batch
=
db
.
CreateBatch
();
for
(
int
j
=
0
;
j
<
tasks
.
Length
;
j
++)
{
tasks
[
j
]
=
batch
.
PingAsync
(
);
tasks
[
j
]
=
batch
.
ExecuteAsync
(
"echo"
,
"echo"
+
j
);
}
batch
.
Execute
();
db
.
Multiplexer
.
WaitAll
(
tasks
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment