Redis Pop list item By numbers of items
<p>I have a distributed system where In one place i insert around 10000 items in a redis list then Call my multiple applications hook to process items. what i need is to Have some ListLeftPop type of methhod with numbers of items. It should remove items from the redis List and return to my calling application.</p>

<p>I am using Stackexchange.Resis.extension</p>

<p>My current method just for get (not pop) is </p>

<pre><code> public static List&lt;T&gt; GetListItemRange&lt;T&gt;(string key, int start, int chunksize) where T : class
        {
            List&lt;T&gt; obj = default(List&lt;T&gt;);
            try
            {
                if (Muxer != null &amp;&amp; Muxer.IsConnected &amp;&amp; Muxer.GetDatabase() != null)
                {
                    var cacheClient = new StackExchangeRedisCacheClient(Muxer, new NewtonsoftSerializer());
                    var redisValues = cacheClient.Database.ListRange(key, start, (start + chunksize - 1));
                    if (redisValues.Length &gt; 0)
                    {
                        obj = Array.ConvertAll(redisValues, value =&gt; JsonConvert.DeserializeObject&lt;T&gt;(value)).ToList();
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.Fatal(ex.Message, ex);
            }
            return obj;
        }
</code></pre>

<p>For Pop and get i have find a snippet</p>

<pre><code> var cacheClient = new StackExchangeRedisCacheClient(Muxer, new NewtonsoftSerializer());
                    var redisValues = cacheClient.ListGetFromRight&lt;T&gt;(key);
</code></pre>

<p>But it will only do for single item</p>