title: use publish/subscribe with sider redis C# client
body: <p>I am using Sider C# Redis client to connect to Redis server running on my windows 7 machine.
  <a href="https://github.com/chakrit/sider" rel="nofollow">https://github.com/chakrit/sider</a></p>
  
  <p>I am able to fire set/get/select from my C# application</p>
  
  <p>I now want to use the <strong>Publish/Subscribe</strong> feature so that my C# app can be informed about any changes in the redis client's "key" in an <strong>evented way (passing delegates)</strong> </p>
  
  <p>I am unable to write the code for that as there are no examples on how to use the sider client page.</p>
  
  <p>all i could write was this  :</p>
  
  <pre><code>var client = new RedisClient(address, 6379);
  string[] keys = new string[1];
  keys[0] = "key1ToMonitor";
  IObservable&lt;Message&lt;string&gt;&gt; obb = client.Subscribe(keys);
  </code></pre>
  
  <p>I know this looks lame but i got no clue how to write it in an lambda way where my function would be called if any client changes the desired keys on the redis server.</p>
  
  <p>PS : I am new to this so correct me if my approach is flawed.</p>
  
  <p><strong>Edit</strong> : on adding the suggested changes i am getting the following error.</p>
  
  <pre><code>Error   7   Cannot convert lambda expression to type 'System.IObserver&lt;Sider.Message&lt;string&gt;&gt;' because it is not a delegate type    D:\_Work\TestApp\Program.cs 90  27  TestApp
  </code></pre>
  
  <p>the obb.subscribe signature looks like this</p>
  
  <pre><code>namespace System
  {
      // Summary:
      //     Defines a provider for push-based notification.
      //
      // Type parameters:
      //   T:
      //     The object that provides notification information.This type parameter is
      //     covariant. That is, you can use either the type you specified or any type
      //     that is more derived. For more information about covariance and contravariance,
      //     see Covariance and Contravariance in Generics.
      public interface IObservable&lt;out T&gt;
      {
          // Summary:
          //     Notifies the provider that an observer is to receive notifications.
          //
          // Parameters:
          //   observer:
          //     The object that is to receive notifications.
          //
          // Returns:
          //     The observer's interface that enables resources to be disposed.
          IDisposable Subscribe(IObserver&lt;T&gt; observer);
      }
  }
  </code></pre>
  
  <p><strong>code :</strong></p>
  
  <pre><code>        var client = new RedisClient(address, 6379);
          string[] keys = new string[1];
          keys[0] = "key1ToMonitor";
          IObservable&lt;Message&lt;string&gt;&gt; obb = client.Subscribe(keys);
          obb.Subscribe(x =&gt; Debug.WriteLine(x.ToString()) ); // error : doesn't let me compile  
  </code></pre>