You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by solanpaa January 28, 2025
Hi,
I'm developing custom transactions for our use case. There I need to call, e.g., IGarnetApi.SortedSetCount. How do I set the input and read the output?
Minimum example of my issue
usingGarnet.common;usingGarnet.server;usingTsavorite.core;namespaceGarnet{publicclassMyTx:CustomTransactionProcedure{publicoverrideboolPrepare<TGarnetReadApi>(TGarnetReadApiapi,refCustomProcedureInputinput){intoffset=0;// Lock the key for exclusive accessAddKey(GetNextArg(refinput,refoffset),LockType.Exclusive,true);returntrue;}publicoverridevoidMain<TGarnetApi>(TGarnetApiapi,refCustomProcedureInputinput,refMemoryResult<byte>output){intoffset=0;varkey=GetNextArg(refinput,refoffset);varminScore=GetNextArg(refinput,refoffset);varmaxScore=GetNextArg(refinput,refoffset);varkeyBytes=key.ToArray();//// HELP: How to set zcountInput to correspond to 'minScore maxScore'?//ObjectInputzcountInput=newObjectInput();GarnetObjectStoreOutputzcountOutput=newGarnetObjectStoreOutput();varstatus=api.SortedSetCount(keyBytes,refzcountInput,refzcountOutput);//// HELP: How to read count from zcountOutput?//intcountOutput=0;// <- ??varmyCalculation=countOutput+1;WriteSimpleString(refoutput,myCalculation.ToString());}}}
I tried looking up different ways ObjectInput and GarnetObjectStoreOutput are used within the codebase, but most uses seem to rely on internal-only functionalities. Would appreciate some pointers on how to use these in my own extensions
The text was updated successfully, but these errors were encountered:
Discussed in #967
Originally posted by solanpaa January 28, 2025
Hi,
I'm developing custom transactions for our use case. There I need to call, e.g., IGarnetApi.SortedSetCount. How do I set the input and read the output?
Minimum example of my issue
I tried looking up different ways
ObjectInput
andGarnetObjectStoreOutput
are used within the codebase, but most uses seem to rely on internal-only functionalities. Would appreciate some pointers on how to use these in my own extensionsThe text was updated successfully, but these errors were encountered: