summaryrefslogtreecommitdiff
path: root/redis/asyncio/client.py
Commit message (Collapse)AuthorAgeFilesLines
* fix create single_connection_client from url (#2752)dvora-h2023-05-081-1/+5
|
* Optionally disable disconnects in read_response (#2695)Kristján Valur Jónsson2023-05-081-66/+27
| | | | | | | | | | | | | * Add regression tests and fixes for issue #1128 * Fix tests for resumable read_response to use "disconnect_on_error" * undo prevision fix attempts in async client and cluster * re-enable cluster test * Suggestions from code review * Add CHANGES
* clean warnings (#2731)dvora-h2023-05-081-1/+1
|
* Fix async (#2673)dvora-h2023-03-291-7/+3
|
* Fixing cancelled async futures (#2666)Chayim2023-03-291-30/+69
| | | | | Co-authored-by: James R T <jamestiotio@gmail.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Fix issue 2660: PytestUnraisableExceptionWarning from asycio client (#2669)shacharPash2023-03-281-0/+5
|
* AsyncIO Race Condition Fix (#2641)v4.5.3Chayim2023-03-221-3/+9
|
* Fix issue 2540: Synchronise concurrent command calls to single-client mode. ↵Vivanov982023-01-291-2/+13
| | | | | (#2568) Co-authored-by: Viktor Ivanov <viktor@infogrid.io>
* Fix incorrect _disconnect_raise docstring (#2534)Mohsin Haider2023-01-051-2/+2
|
* replase get_event_loop wite get_running_loop (#2530)dvora-h2023-01-051-2/+2
|
* Combine auto-concatenated strings (#2482)David Gilman2022-12-141-3/+3
|
* Async: added 'blocking' argument to call lock method (#2454)Sibuken2022-12-011-0/+8
| | | Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Failover handling improvements for RedisCluster and Async RedisCluster (#2377)Bar Shaul2022-11-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cluster&AsyncCluster: Removed handling of timeouts/connection errors within the cluster loop, fixed "cannot pickle '_thread.lock' object" bug, added client's side failover handling improvements * Fixed linters * Type fixes * Added to CHANGES * Added getter and setter for the client's retry object and added more tests * Fixed linters * Fixed test * Fixed test_client_kill test * Changed get_default_backoff to default_backoff, removed retry_on_error and connection_error_retry_attempts from RedisCluster, default retry changed to no retries * Fixing linters * Reverting deletion of connection_error_retry_attempts to maintain backward compatibility * Updating retry object for existing and new connections * Changed the default value of reinitialize_steps from 10 to 5 * fix review comments Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* CredentialsProvider class added to support password rotation (#2261)Bar Shaul2022-11-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A CredentialsProvider class has been added to allow the user to add his own provider for password rotation * Moved CredentialsProvider to a separate file, added type hints * Changed username and password to properties * Added: StaticCredentialProvider, examples, tests Changed: CredentialsProvider to CredentialProvider Fixed: calling AUTH only with password * Changed private members' prefix to __ * fixed linters * fixed auth test * fixed credential test * Raise an error if username or password are passed along with credential_provider * fixing linters * fixing test * Changed dundered to single per side underscore * Changed Connection class members username and password to properties to enable backward compatibility with changing the members value on existing connection. * Reverting last commit and adding backward compatibility to 'username' and 'password' inside on_connect function * Refactored CredentialProvider class * Fixing tuple type to Tuple * Fixing optional string members in UsernamePasswordCredentialProvider * Fixed credential test * Added credential provider support to AsyncRedis * linters * linters * linters * linters - black Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Fix special response parsing options handling (#2302)Shay Fadida2022-11-091-0/+5
| | | | | | | | | | | | | | | | | * Fix special response parsing options handling When using special response parsing options like `NEVER_DECODE` and `EMPTY_RESPONSE`, don't pass them to the response callbacks because some of them are not prepared for receiving named arguments. Instead, redis-py should use them before calling the callbacks and then discard them. * Use kwargs instead of options * change options to kwargs in asyncio/cluster.py/L878 Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* fix docs for password protected socket access (#2378)Robert Hofer2022-11-071-1/+1
| | | Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Simplify async timeouts and allowing `timeout=None` in ↵v4.4.0rc2Kristján Valur Jónsson2022-09-291-17/+5
| | | | | | | | | | | | | | | | | | | `PubSub.get_message()` to wait forever (#2295) * Avoid an extra "can_read" call and use timeout directly. * Remove low-level read timeouts from the Parser, now handled in the Connection * Allow pubsub.get_message(time=None) to block. * update Changes * increase test timeout for robustness * expand with statement to avoid invoking null context managers. remove nullcontext * Remove unused import
* Dev/no can read (#2360)Kristján Valur Jónsson2022-09-291-7/+15
| | | | | | | | * make can_read() destructive for simplicity, and rename the method. Remove timeout argument, always timeout immediately. * don't use can_read in pubsub * connection.connect() now has its own retry, don't need it inside a retry loop
* automatically reconnect pubsub when reading messages in blocking mode (#2281)Kristján Valur Jónsson2022-07-271-3/+9
| | | | | | | | | | | | | | | | * optimistic default info on test sessionstart. Makes test discovery work, even without a redis connection. * Add unittests verifying that (non-async) PubSub will automatically reconnect * Add tests for asyncio pubsub subsciription auto-reconnect * automatically connect for blocking reads (asyncio) * fix automatic connect on blocking pubsub read (non-async) * lint & format * Perform `connect()` call in PubSub code rather than `read_response`.
* Fix retries in async mode (#2180)Eric Lemoine2022-06-191-3/+14
| | | | | | | | | * Avoid mutating a global retry_on_error list * Make retries config consistent in sync and async * Fix async retries * Add new TestConnectionConstructorWithRetry tests
* Add Async RedisCluster (#2099)Utkarsh Gupta2022-05-081-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Copy Cluster Client, Commands, Commands Parser, Tests for asyncio * Async Cluster Tests: Async/Await * Add Async RedisCluster * cluster: use ERRORS_ALLOW_RETRY from self.__class__ * async_cluster: rework redis_connection, initialize, & close - move redis_connection from NodesManager to ClusterNode & handle all related logic in ClusterNode class - use Locks while initializing or closing - in case of error, close connections instead of instantly reinitializing - create ResourceWarning instead of manually deleting client object - use asyncio.gather to run commands/initialize/close in parallel - inline single use functions - fix test_acl_log for py3.6 * async_cluster: add types * async_cluster: add docs * docs: update sphinx & add sphinx_autodoc_typehints * async_cluster: move TargetNodesT to cluster module * async_cluster/commands: inherit commands from sync class if possible * async_cluster: add benchmark script with aredis & aioredis-cluster * async_cluster: remove logging * async_cluster: inline functions * async_cluster: manage Connection instead of Redis Client * async_cluster/commands: optimize parser * async_cluster: use ensure_future & generators for gather * async_conn: optimize * async_cluster: optimize determine_slot * async_cluster: optimize determine_nodes * async_cluster/parser: optimize _get_moveable_keys * async_cluster: inlined check_slots_coverage * async_cluster: update docstrings * async_cluster: add concurrent test & use read_response/_update_moved_slots without lock Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Async Connection: Allow `PubSub.run()` without previous `subscribe()` (#2148)Kristján Valur Jónsson2022-05-021-3/+12
|
* Add async supoort for SEARCH commands (#2096)dvora-h2022-04-281-2/+2
| | | | | | | | | | | | | * Add async supoort for SEARCH commands * linters * linters * linters * linters * linters
* Async tests for redis commands, json, bloom, timeseries (#2087)dvora-h2022-04-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * test async commands * test async json commands * test async timeseries commands * test async bloom commands * linters * linters * skip on cluster * linters * linters * isort * flynt * remove print
* fix asynic/client.py's import (#2079)wwqgtxx2022-04-041-2/+2
| | | | | | | * fix asynic/client.py's import Lock and Retry should be from redis.asyncio * for code linters
* Fix disable decode for dump command on asyncio (#2070)Mason2022-04-041-1/+1
| | | Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Add support to use certificates from string in ssl connection (#2048)dvora-h2022-03-141-0/+2
| | | | | | | | | * ssl string cert * fix async test * linters * change test name
* Implement locks for RedisCluster (#2013)Jake Barnwell2022-03-011-1/+4
| | | | | | | | | | | | | | | | | | | * Add support for .lock() for RedisCluster * Update changelog with lua scripting and lock() changes * Also update asyncio client .lock() doc * Add Python 3.6 back to hash verify CI (#2008) * Renaming chore as maintenance (#2015) * Add AsyncFunctionCommands (#2009) * Also update asyncio client .lock() doc Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Add Async Support (#1899)Andrew Chen Wang2022-02-221-0/+1344
Co-authored-by: Chayim I. Kirshen <c@kirshen.com> Co-authored-by: dvora-h <dvora.heller@redis.com>