Last active
December 11, 2015 10:48
-
-
Save skinny/4589444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StockChangeListener | |
{ | |
private readonly IRedisClient _client; | |
private readonly ILog _log; | |
public StockChangeListener(IRedisClient client, ILog log) | |
{ | |
_client = client; | |
_log = log; | |
Init(); | |
} | |
private void Init() | |
{ | |
using (var subscription = _client.CreateSubscription()) | |
{ | |
subscription.OnMessage = (channel, msg) => | |
{ | |
Console.WriteLine(msg); | |
}; | |
subscription.SubscribeToChannelsMatching("stock.*"); | |
} | |
} | |
} | |
public class SolrModule : NinjectModule | |
{ | |
public override void Load() | |
{ | |
Bind<StockChangeListener>().To<StockChangeListener>().InSingletonScope(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment