Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 9d51653

Browse files
committed
Changed namespace for Pipeline classes to match folder structure.
Changed Interface name to use 'Shared' instead of 'Base'
1 parent 22f8168 commit 9d51653

22 files changed

Lines changed: 155 additions & 140 deletions
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
namespace ServiceStack.Redis.Generic
1+
using ServiceStack.Redis.Pipeline;
2+
3+
namespace ServiceStack.Redis.Generic
24
{
35
/// <summary>
46
/// Interface to redis typed pipeline
57
/// </summary>
6-
public interface IRedisTypedPipeline<T> : IRedisPipelineBase, IRedisTypedQueueableOperation<T>
8+
public interface IRedisTypedPipeline<T> : IRedisPipelineShared, IRedisTypedQueueableOperation<T>
79
{
810
}
911
}

src/ServiceStack.Redis/Generic/QueuedRedisTypedCommand.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using ServiceStack.Redis.Generic;
4+
using ServiceStack.Redis.Pipeline;
45

56
namespace ServiceStack.Redis.Generic
67
{

src/ServiceStack.Redis/Generic/RedisTypedClient.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using ServiceStack.Common.Extensions;
1818
using ServiceStack.Common.Utils;
1919
using ServiceStack.DesignPatterns.Model;
20+
using ServiceStack.Redis.Pipeline;
2021
using ServiceStack.Text;
2122

2223
namespace ServiceStack.Redis.Generic
@@ -85,7 +86,7 @@ public IRedisTransactionBase Transaction
8586
client.Transaction = value;
8687
}
8788
}
88-
public IRedisPipelineBase Pipeline
89+
public IRedisPipelineShared Pipeline
8990
{
9091
get
9192
{

src/ServiceStack.Redis/Generic/RedisTypedTransaction.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
using System;
1414
using System.Collections.Generic;
15+
using ServiceStack.Redis.Pipeline;
1516

1617
namespace ServiceStack.Redis.Generic
1718
{
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace ServiceStack.Redis
1+
namespace ServiceStack.Redis.Pipeline
22
{
3-
/// <summary>
4-
/// Interface to redis pipeline
5-
/// </summary>
6-
public interface IRedisPipeline : IRedisPipelineBase, IRedisQueueableOperation
7-
{
8-
}
9-
}
3+
/// <summary>
4+
/// Interface to redis pipeline
5+
/// </summary>
6+
public interface IRedisPipeline : IRedisPipelineShared, IRedisQueueableOperation
7+
{
8+
}
9+
}

src/ServiceStack.Redis/Pipeline/IRedisPipelineBase.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
3+
namespace ServiceStack.Redis.Pipeline
4+
{
5+
/// <summary>
6+
/// Base pipeline interface, shared by typed and non-typed pipelines
7+
/// </summary>
8+
public interface IRedisPipelineShared : IDisposable, IRedisQueueCompletableOperation
9+
{
10+
void Flush();
11+
void Replay();
12+
}
13+
}

src/ServiceStack.Redis/Pipeline/IRedisQueueCompletableOperation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace ServiceStack.Redis
4+
namespace ServiceStack.Redis.Pipeline
55
{
6-
/// <summary>
7-
/// Interface to operations that allow queued commands to be completed
8-
/// </summary>
6+
/// <summary>
7+
/// Interface to operations that allow queued commands to be completed
8+
/// </summary>
99
public interface IRedisQueueCompletableOperation
1010
{
1111
void CompleteVoidQueuedCommand(Action voidReadCommand);
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace ServiceStack.Redis
4+
namespace ServiceStack.Redis.Pipeline
55
{
6-
/// <summary>
7-
/// interface to operation that can queue commands
8-
/// </summary>
9-
public interface IRedisQueueableOperation
10-
{
11-
void QueueCommand(Action<IRedisClient> command);
12-
void QueueCommand(Action<IRedisClient> command, Action onSuccessCallback);
13-
void QueueCommand(Action<IRedisClient> command, Action onSuccessCallback, Action<Exception> onErrorCallback);
14-
15-
void QueueCommand(Func<IRedisClient, int> command);
16-
void QueueCommand(Func<IRedisClient, int> command, Action<int> onSuccessCallback);
17-
void QueueCommand(Func<IRedisClient, int> command, Action<int> onSuccessCallback, Action<Exception> onErrorCallback);
18-
19-
void QueueCommand(Func<IRedisClient, long> command);
20-
void QueueCommand(Func<IRedisClient, long> command, Action<long> onSuccessCallback);
21-
void QueueCommand(Func<IRedisClient, long> command, Action<long> onSuccessCallback, Action<Exception> onErrorCallback);
22-
23-
void QueueCommand(Func<IRedisClient, bool> command);
24-
void QueueCommand(Func<IRedisClient, bool> command, Action<bool> onSuccessCallback);
25-
void QueueCommand(Func<IRedisClient, bool> command, Action<bool> onSuccessCallback, Action<Exception> onErrorCallback);
26-
27-
void QueueCommand(Func<IRedisClient, double> command);
28-
void QueueCommand(Func<IRedisClient, double> command, Action<double> onSuccessCallback);
29-
void QueueCommand(Func<IRedisClient, double> command, Action<double> onSuccessCallback, Action<Exception> onErrorCallback);
30-
31-
void QueueCommand(Func<IRedisClient, byte[]> command);
32-
void QueueCommand(Func<IRedisClient, byte[]> command, Action<byte[]> onSuccessCallback);
33-
void QueueCommand(Func<IRedisClient, byte[]> command, Action<byte[]> onSuccessCallback, Action<Exception> onErrorCallback);
34-
35-
void QueueCommand(Func<IRedisClient, string> command);
36-
void QueueCommand(Func<IRedisClient, string> command, Action<string> onSuccessCallback);
37-
void QueueCommand(Func<IRedisClient, string> command, Action<string> onSuccessCallback, Action<Exception> onErrorCallback);
38-
39-
void QueueCommand(Func<IRedisClient, List<string>> command);
40-
void QueueCommand(Func<IRedisClient, List<string>> command, Action<List<string>> onSuccessCallback);
41-
void QueueCommand(Func<IRedisClient, List<string>> command, Action<List<string>> onSuccessCallback, Action<Exception> onErrorCallback);
6+
/// <summary>
7+
/// interface to operation that can queue commands
8+
/// </summary>
9+
public interface IRedisQueueableOperation
10+
{
11+
void QueueCommand(Action<IRedisClient> command);
12+
void QueueCommand(Action<IRedisClient> command, Action onSuccessCallback);
13+
void QueueCommand(Action<IRedisClient> command, Action onSuccessCallback, Action<Exception> onErrorCallback);
14+
15+
void QueueCommand(Func<IRedisClient, int> command);
16+
void QueueCommand(Func<IRedisClient, int> command, Action<int> onSuccessCallback);
17+
void QueueCommand(Func<IRedisClient, int> command, Action<int> onSuccessCallback, Action<Exception> onErrorCallback);
18+
19+
void QueueCommand(Func<IRedisClient, long> command);
20+
void QueueCommand(Func<IRedisClient, long> command, Action<long> onSuccessCallback);
21+
void QueueCommand(Func<IRedisClient, long> command, Action<long> onSuccessCallback, Action<Exception> onErrorCallback);
22+
23+
void QueueCommand(Func<IRedisClient, bool> command);
24+
void QueueCommand(Func<IRedisClient, bool> command, Action<bool> onSuccessCallback);
25+
void QueueCommand(Func<IRedisClient, bool> command, Action<bool> onSuccessCallback, Action<Exception> onErrorCallback);
26+
27+
void QueueCommand(Func<IRedisClient, double> command);
28+
void QueueCommand(Func<IRedisClient, double> command, Action<double> onSuccessCallback);
29+
void QueueCommand(Func<IRedisClient, double> command, Action<double> onSuccessCallback, Action<Exception> onErrorCallback);
30+
31+
void QueueCommand(Func<IRedisClient, byte[]> command);
32+
void QueueCommand(Func<IRedisClient, byte[]> command, Action<byte[]> onSuccessCallback);
33+
void QueueCommand(Func<IRedisClient, byte[]> command, Action<byte[]> onSuccessCallback, Action<Exception> onErrorCallback);
34+
35+
void QueueCommand(Func<IRedisClient, string> command);
36+
void QueueCommand(Func<IRedisClient, string> command, Action<string> onSuccessCallback);
37+
void QueueCommand(Func<IRedisClient, string> command, Action<string> onSuccessCallback, Action<Exception> onErrorCallback);
38+
39+
void QueueCommand(Func<IRedisClient, List<string>> command);
40+
void QueueCommand(Func<IRedisClient, List<string>> command, Action<List<string>> onSuccessCallback);
41+
void QueueCommand(Func<IRedisClient, List<string>> command, Action<List<string>> onSuccessCallback, Action<Exception> onErrorCallback);
4242

43-
}
44-
}
43+
}
44+
}
Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace ServiceStack.Redis
4+
namespace ServiceStack.Redis.Pipeline
55
{
6-
/// <summary>
7-
/// A complete redis command, with method to send command, receive response, and run callback on success or failure
8-
/// </summary>
9-
internal class QueuedRedisCommand : RedisCommand
10-
{
11-
public override void Execute(IRedisClient client)
12-
{
13-
try
14-
{
15-
if (VoidReturnCommand != null)
16-
{
17-
VoidReturnCommand(client);
18-
19-
}
20-
else if (IntReturnCommand != null)
21-
{
22-
IntReturnCommand(client);
23-
24-
}
25-
else if (LongReturnCommand != null)
26-
{
27-
LongReturnCommand(client);
28-
29-
}
30-
else if (DoubleReturnCommand != null)
31-
{
32-
DoubleReturnCommand(client);
33-
34-
}
35-
else if (BytesReturnCommand != null)
36-
{
37-
BytesReturnCommand(client);
38-
39-
}
40-
else if (StringReturnCommand != null)
41-
{
42-
StringReturnCommand(client);
43-
44-
}
45-
else if (MultiBytesReturnCommand != null)
46-
{
47-
MultiBytesReturnCommand(client);
48-
49-
}
50-
else if (MultiStringReturnCommand != null)
51-
{
52-
MultiStringReturnCommand(client);
53-
54-
}
55-
}
56-
catch (Exception ex)
57-
{
58-
Log.Error(ex);
59-
}
6+
/// <summary>
7+
/// A complete redis command, with method to send command, receive response, and run callback on success or failure
8+
/// </summary>
9+
internal class QueuedRedisCommand : RedisCommand
10+
{
11+
public override void Execute(IRedisClient client)
12+
{
13+
try
14+
{
15+
if (VoidReturnCommand != null)
16+
{
17+
VoidReturnCommand(client);
18+
19+
}
20+
else if (IntReturnCommand != null)
21+
{
22+
IntReturnCommand(client);
23+
24+
}
25+
else if (LongReturnCommand != null)
26+
{
27+
LongReturnCommand(client);
28+
29+
}
30+
else if (DoubleReturnCommand != null)
31+
{
32+
DoubleReturnCommand(client);
33+
34+
}
35+
else if (BytesReturnCommand != null)
36+
{
37+
BytesReturnCommand(client);
38+
39+
}
40+
else if (StringReturnCommand != null)
41+
{
42+
StringReturnCommand(client);
43+
44+
}
45+
else if (MultiBytesReturnCommand != null)
46+
{
47+
MultiBytesReturnCommand(client);
48+
49+
}
50+
else if (MultiStringReturnCommand != null)
51+
{
52+
MultiStringReturnCommand(client);
53+
54+
}
55+
}
56+
catch (Exception ex)
57+
{
58+
Log.Error(ex);
59+
}
6060

61-
}
62-
}
63-
}
61+
}
62+
}
63+
}

0 commit comments

Comments
 (0)