Skip to content

Instantly share code, notes, and snippets.

@skinny
Last active December 11, 2015 10:48
Show Gist options
  • Save skinny/4589444 to your computer and use it in GitHub Desktop.
Save skinny/4589444 to your computer and use it in GitHub Desktop.
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