-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua binary support #1729
Lua binary support #1729
Conversation
glide-core changes 1. Change InvocationScript message to use bytes instead of strings 2. Fix socket_listener and scripts_container to use byte array for storing scripts 3. update redis commands load, eval and the internal invoke_script to use byte array 4. small refactor in scripts_container java changes 1. Add new script options class for glide string script parameters 2. Fix storeScript ffi according to new message to get bytes array 3. Add new handler handleBinaryObjectOrNullResponse 4. Add Script constructore to get GlideString for script argument 5. Add Script class new member binarySafeOutput to be able to diffrintiate between output types on invocation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace existing options without introducing new classes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fully understand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch existing class to store GlideString
instead of String
1. Change script constructor for to accept PyAny. No noverloads in rust for the constructor and python don't support templates 2. Chage _execute_script to convert keys,args to bytes
1. Change Script consturctor to accept string or uint8array 2. Change ScriptOptions to have args,keys of string or uint8array
keys (Union[str, bytes]): The keys that are used in the script. | ||
args (Union[str, bytes]): The arguments for the script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keys (Union[str, bytes]): The keys that are used in the script. | |
args (Union[str, bytes]): The arguments for the script. | |
keys (List[Union[str, bytes]]): The keys that are used in the script. | |
args (List[Union[str, bytes]]): The arguments for the script. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
@@ -658,7 +660,8 @@ CompletableFuture<Boolean> pexpireAt( | |||
* @return a value that depends on the script that was executed. | |||
* @example | |||
* <pre>{@code | |||
* try(Script luaScript = new Script("return { KEYS[1], ARGV[1] }")) { | |||
* try(Script luaScript = new Script("return { KEYS[1], ARGV[1] }", true)) { | |||
* luaScript.setBinarySafeOutput(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* luaScript.setBinarySafeOutput(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -635,7 +636,8 @@ CompletableFuture<Boolean> pexpireAt( | |||
* @return a value that depends on the script that was executed. | |||
* @example | |||
* <pre>{@code | |||
* try(Script luaScript = new Script("return 'Hello'")) { | |||
* try(Script luaScript = new Script("return 'Hello'", true)) { | |||
* luaScript.setBinarySafeOutput(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* luaScript.setBinarySafeOutput(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
* Add support for GlideString for Lua scripts glide-core changes 1. Change InvocationScript message to use bytes instead of strings 2. Fix socket_listener and scripts_container to use byte array for storing scripts 3. update redis commands load, eval and the internal invoke_script to use byte array 4. small refactor in scripts_container java changes 1. Add new script options class for glide string script parameters 2. Fix storeScript ffi according to new message to get bytes array 3. Add new handler handleBinaryObjectOrNullResponse 4. Add Script constructore to get GlideString for script argument 5. Add Script class new member binarySafeOutput to be able to diffrintiate between output types on invocation python changes 1. Change script constructor for to accept PyAny. No noverloads in rust for the constructor and python don't support templates 2. Chage _execute_script to convert keys,args to bytes node changes 1. Change Script consturctor to accept string or uint8array 2. Change ScriptOptions to have args,keys of string or uint8array --------- Co-authored-by: Yulazari <[email protected]>
Issue #, if available:
Description of changes:
Add support for GlideString for Lua scripts
glide-core changes
java changes
python changes
node changes
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.