I’m really loving the script stuff. I’m looking to use it to generate partition and row keys in a generic way. Is the script context thread safe? Any performance issues here? If I have just one in a singleton class so it only gets init’d one time and am calling it:
Yes ScriptContext is ThreadSafe to be used as a singleton provided all ScriptContext configuration is done prior to calling .Init(). After initialization the only ThreadSafe collections you should modify are the Concurrent Dictionary caches.
The SharpPagesFeature used in #Script Pages is itself a singleton ScriptContext that all pages are executed within.
I don’t understand what relationship your KeyStrategy class has with the ScriptContext, if it’s just used as arguments in your script then there’s no issue.
Thanks, the KeyStrategy iis the singleton class that will have the one script context that will be used to generate all the partition row keys. Just passing into it an item so its key is generated in a consistent manner across the system.