-
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
Added Script API in python. #860
Conversation
python/python/glide/redis_client.py
Outdated
@@ -228,6 +228,30 @@ async def execute_transaction( | |||
await response_future | |||
return response_future.result() | |||
|
|||
async def execute_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.
execute_script => _execute_script
to communicate a private function in python
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.
please also fix execute_transaction => _execute_transaction
request.script_invocation.args[:] = args if args is not None else [] | ||
request.script_invocation.keys[:] = keys if keys is not None else [] | ||
set_protobuf_route(request, route) | ||
# Create a response future for this request and add it to the available |
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.
since the lines from here to the end of the function are repeating both in execute_command and execute_pipeline, lets move it to a separate function:
async def _write_request_await_response(self, request: RedisRequest):
# Create a response future for this request and add it to the available
# futures map
response_future = self._get_future(request.callback_idx)
self._create_write_task(request)
await response_future
return response_future.result()
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.
Fix & merge
3d4ecfc
to
65c96d1
Compare
65c96d1
to
dac826c
Compare
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.