File tree Expand file tree Collapse file tree 5 files changed +25
-10
lines changed
src/InEngine.Core/Queuing Expand file tree Collapse file tree 5 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 33using System . Data ;
44using System . Data . SqlClient ;
55using System . Linq ;
6+ using InEngine . Core . Commands ;
67using InEngine . Core . Exceptions ;
78using InEngine . Core . Queuing . Clients . Database ;
89using Newtonsoft . Json ;
@@ -32,6 +33,11 @@ public void Publish(ICommand command)
3233 }
3334 }
3435
36+ public void Publish ( Action action )
37+ {
38+ Publish ( new Lambda ( ) { Action = action } ) ;
39+ }
40+
3541 public bool Consume ( )
3642 {
3743
Original file line number Diff line number Diff line change 22using System . Collections . Generic ;
33using System . IO ;
44using System . Linq ;
5+ using InEngine . Core . Commands ;
56using InEngine . Core . Exceptions ;
67
78namespace InEngine . Core . Queuing . Clients
@@ -58,6 +59,11 @@ public void Publish(ICommand command)
5859 }
5960 }
6061
62+ public void Publish ( Action action )
63+ {
64+ Publish ( new Lambda ( ) { Action = action } ) ;
65+ }
66+
6167 public bool Consume ( )
6268 {
6369 var fileInfo = new DirectoryInfo ( PendingQueuePath )
Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
33using System . Linq ;
4- using System . Reflection ;
5- using System . Threading . Tasks ;
4+ using InEngine . Core . Commands ;
65using InEngine . Core . Exceptions ;
7- using Newtonsoft . Json ;
86using StackExchange . Redis ;
97
108namespace InEngine . Core . Queuing . Clients
@@ -27,16 +25,15 @@ public class RedisClient : IQueueClient
2725 } ) ;
2826 public static ConnectionMultiplexer Connection { get { return lazyConnection . Value ; } }
2927 public ConnectionMultiplexer _connectionMultiplexer ;
30- public IDatabase Redis
31- {
32- get
33- {
34- return Connection . GetDatabase ( RedisDb ) ;
35- }
36- }
28+ public IDatabase Redis { get { return Connection . GetDatabase ( RedisDb ) ; } }
3729 public bool UseCompression { get ; set ; }
3830 public int RedisDb { get ; set ; }
3931
32+ public void Publish ( Action action )
33+ {
34+ Publish ( new Lambda ( ) { Action = action } ) ;
35+ }
36+
4037 public void Publish ( ICommand command )
4138 {
4239 Redis . ListLeftPush (
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ public interface IQueueClient
99 string QueueName { get ; set ; }
1010 bool UseCompression { get ; set ; }
1111 void Publish ( ICommand command ) ;
12+ void Publish ( Action action ) ;
1213 bool Consume ( ) ;
1314 long GetPendingQueueLength ( ) ;
1415 long GetInProgressQueueLength ( ) ;
Original file line number Diff line number Diff line change @@ -49,6 +49,11 @@ public static Queue Make(bool useSecondaryQueue = false)
4949 return queue ;
5050 }
5151
52+ public void Publish ( Action action )
53+ {
54+ QueueClient . Publish ( action ) ;
55+ }
56+
5257 public void Publish ( ICommand command )
5358 {
5459 QueueClient . Publish ( command ) ;
You can’t perform that action at this time.
0 commit comments