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
21704849
Commit
21704849
authored
Mar 11, 2019
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try pipelines v2 - now with "ref T Current"
parent
4ebacd62
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
20 deletions
+16
-20
RawResult.cs
src/StackExchange.Redis/RawResult.cs
+2
-3
RedisResult.cs
src/StackExchange.Redis/RedisResult.cs
+2
-3
RedisTransaction.cs
src/StackExchange.Redis/RedisTransaction.cs
+3
-4
ResultProcessor.cs
src/StackExchange.Redis/ResultProcessor.cs
+8
-9
StackExchange.Redis.csproj
src/StackExchange.Redis/StackExchange.Redis.csproj
+1
-1
No files found.
src/StackExchange.Redis/RawResult.cs
View file @
21704849
...
@@ -302,9 +302,8 @@ static GeoPosition AsGeoPosition(Sequence<RawResult> coords)
...
@@ -302,9 +302,8 @@ static GeoPosition AsGeoPosition(Sequence<RawResult> coords)
}
}
else
else
{
{
var
iter
=
coords
.
GetEnumerator
();
longitude
=
(
double
)
coords
[
0
].
AsRedisValue
();
longitude
=
(
double
)
iter
.
GetNext
().
AsRedisValue
();
latitude
=
(
double
)
coords
[
1
].
AsRedisValue
();
latitude
=
(
double
)
iter
.
GetNext
().
AsRedisValue
();
}
}
return
new
GeoPosition
(
longitude
,
latitude
);
return
new
GeoPosition
(
longitude
,
latitude
);
...
...
src/StackExchange.Redis/RedisResult.cs
View file @
21704849
...
@@ -61,10 +61,9 @@ internal static RedisResult TryCreate(PhysicalConnection connection, in RawResul
...
@@ -61,10 +61,9 @@ internal static RedisResult TryCreate(PhysicalConnection connection, in RawResul
if
(
items
.
Length
==
0
)
return
EmptyArray
;
if
(
items
.
Length
==
0
)
return
EmptyArray
;
var
arr
=
new
RedisResult
[
items
.
Length
];
var
arr
=
new
RedisResult
[
items
.
Length
];
int
i
=
0
;
int
i
=
0
;
var
iter
=
items
.
GetEnumerator
();
foreach
(
ref
RawResult
item
in
items
)
while
(
iter
.
MoveNext
())
{
{
var
next
=
TryCreate
(
connection
,
in
ite
r
.
CurrentReference
);
var
next
=
TryCreate
(
connection
,
in
ite
m
);
if
(
next
==
null
)
return
null
;
// means we didn't understand
if
(
next
==
null
)
return
null
;
// means we didn't understand
arr
[
i
++]
=
next
;
arr
[
i
++]
=
next
;
}
}
...
...
src/StackExchange.Redis/RedisTransaction.cs
View file @
21704849
...
@@ -505,12 +505,11 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
...
@@ -505,12 +505,11 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
connection
?.
BridgeCouldBeNull
?.
Multiplexer
?.
OnTransactionLog
(
$"processing
{
arr
.
Length
}
wrapped messages"
);
connection
?.
BridgeCouldBeNull
?.
Multiplexer
?.
OnTransactionLog
(
$"processing
{
arr
.
Length
}
wrapped messages"
);
int
i
=
0
;
int
i
=
0
;
var
iter
=
arr
.
GetEnumerator
();
foreach
(
ref
RawResult
item
in
arr
)
while
(
iter
.
MoveNext
())
{
{
var
inner
=
wrapped
[
i
++].
Wrapped
;
var
inner
=
wrapped
[
i
++].
Wrapped
;
connection
?.
BridgeCouldBeNull
?.
Multiplexer
?.
OnTransactionLog
(
$"> got
{
ite
r
.
Current
}
for
{
inner
.
CommandAndKey
}
"
);
connection
?.
BridgeCouldBeNull
?.
Multiplexer
?.
OnTransactionLog
(
$"> got
{
ite
m
}
for
{
inner
.
CommandAndKey
}
"
);
if
(
inner
.
ComputeResult
(
connection
,
i
ter
.
CurrentReference
))
if
(
inner
.
ComputeResult
(
connection
,
i
n
item
))
{
{
inner
.
Complete
();
inner
.
Complete
();
}
}
...
...
src/StackExchange.Redis/ResultProcessor.cs
View file @
21704849
...
@@ -719,9 +719,9 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
...
@@ -719,9 +719,9 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
var
iter
=
result
.
GetItems
().
GetEnumerator
();
var
iter
=
result
.
GetItems
().
GetEnumerator
();
while
(
iter
.
MoveNext
())
while
(
iter
.
MoveNext
())
{
{
ref
RawResult
key
=
ref
iter
.
Current
Reference
;
ref
RawResult
key
=
ref
iter
.
Current
;
if
(!
iter
.
MoveNext
())
break
;
if
(!
iter
.
MoveNext
())
break
;
ref
RawResult
val
=
ref
iter
.
Current
Reference
;
ref
RawResult
val
=
ref
iter
.
Current
;
if
(
key
.
IsEqual
(
CommonReplies
.
timeout
)
&&
val
.
TryGetInt64
(
out
long
i64
))
if
(
key
.
IsEqual
(
CommonReplies
.
timeout
)
&&
val
.
TryGetInt64
(
out
long
i64
))
{
{
...
@@ -1494,12 +1494,12 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
...
@@ -1494,12 +1494,12 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
var
streams
=
result
.
GetItems
().
ToArray
((
in
RawResult
item
,
in
MultiStreamProcessor
obj
)
=>
var
streams
=
result
.
GetItems
().
ToArray
((
in
RawResult
item
,
in
MultiStreamProcessor
obj
)
=>
{
{
var
details
=
item
.
GetItems
()
.
GetEnumerator
()
;
var
details
=
item
.
GetItems
();
// details[0] = Name of the Stream
// details[0] = Name of the Stream
// details[1] = Multibulk Array of Stream Entries
// details[1] = Multibulk Array of Stream Entries
return
new
RedisStream
(
key
:
details
.
GetNext
()
.
AsRedisKey
(),
return
new
RedisStream
(
key
:
details
[
0
]
.
AsRedisKey
(),
entries
:
obj
.
ParseRedisStreamEntries
(
details
.
GetNext
()
));
entries
:
obj
.
ParseRedisStreamEntries
(
details
[
1
]
));
},
this
);
},
this
);
SetResult
(
message
,
streams
);
SetResult
(
message
,
streams
);
...
@@ -1705,11 +1705,10 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
...
@@ -1705,11 +1705,10 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
{
{
consumers
=
third
.
ToArray
((
in
RawResult
item
)
=>
consumers
=
third
.
ToArray
((
in
RawResult
item
)
=>
{
{
var
details
=
item
.
GetItems
().
GetEnumerator
();
var
details
=
item
.
GetItems
();
return
new
StreamConsumer
(
return
new
StreamConsumer
(
name
:
details
.
GetNext
()
.
AsRedisValue
(),
name
:
details
[
0
]
.
AsRedisValue
(),
pendingMessageCount
:
(
int
)
details
.
GetNext
()
.
AsRedisValue
());
pendingMessageCount
:
(
int
)
details
[
1
]
.
AsRedisValue
());
});
});
}
}
...
...
src/StackExchange.Redis/StackExchange.Redis.csproj
View file @
21704849
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="1.
1.14
" />
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="1.
9.3-gf6c121fbdb
" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.5.0" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.5.0" />
<PackageReference Include="System.IO.Pipelines" Version="4.5.1" />
<PackageReference Include="System.IO.Pipelines" Version="4.5.1" />
<PackageReference Include="System.Threading.Channels" Version="4.5.0" />
<PackageReference Include="System.Threading.Channels" Version="4.5.0" />
...
...
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