How to use ServiceStack.Redis GetValuesMap/GetAllEntriesFromHash in pipeline

244 views
Skip to first unread message

Damir Logar

unread,
May 28, 2011, 1:20:00 PM5/28/11
to ServiceStack .NET Open Source REST Web Services Framework
I'm moving all serial calls to pipeline due to latency problems. I
can't get to work GetValuesMap and GetAllEntries in QueueCommand.

trans.QueueCommand(r => r.GetValuesMap(keystoget), nums =>
getvalueresultmap = nums);
trans.QueueCommand(r => r.GetAllEntriesFromHash("hashid1"), nums =>
getvalueresultmap = nums);

Errors I get in compile time:
Error 4 Cannot convert lambda expression to delegate type
'System.Func<ServiceStack.Redis.IRedisClient,int>' because some of the
return types in the block are not implicitly convertible to the
delegate return type
Error 5 Cannot implicitly convert type
'System.Collections.Generic.Dictionary<string,string>' to 'int'
Error 6 Delegate 'System.Action' does not take 1 arguments

Are there any workarounds that I'm missing?

Demis Bellot

unread,
May 28, 2011, 1:49:50 PM5/28/11
to servic...@googlegroups.com
Because the API currently doesn't support Redis Batch operations inside a Transaction/Pipeline (i.e. inside another batch operation).

I think you will be fine leaving the batch operations outside pipeline as it's only an extra call and it's already batched so it's still a win.

Cheers,
Reply all
Reply to author
Forward
0 new messages