valkey-glide-sync 2.2.7__tar.gz → 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/PKG-INFO +182 -3
- valkey_glide_sync-2.3.0/README.md +368 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/client.rs +15 -0
- valkey_glide_sync-2.3.0/ffi/miri-tests/mock-glide-core/src/compression.rs +39 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/lib.rs +2 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-telemetry/src/lib.rs +31 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-tokio/src/runtime.rs +3 -7
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/src/lib.rs +455 -152
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/Cargo.toml +3 -0
- valkey_glide_sync-2.3.0/glide-core/README.md +66 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/THIRD_PARTY_LICENSES_RUST +19547 -4711
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/build.rs +7 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/aio/mod.rs +7 -81
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/aio/multiplexed_connection.rs +175 -15
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/client.rs +33 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster.rs +7 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_async/connections_logic.rs +20 -15
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_async/mod.rs +283 -261
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_client.rs +5 -13
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_routing.rs +80 -7
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_slotmap.rs +22 -12
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_topology.rs +44 -2
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cmd.rs +63 -7
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/connection.rs +2 -7
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/lib.rs +6 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/parser.rs +1 -0
- valkey_glide_sync-2.3.0/glide-core/redis-rs/redis/src/pubsub_synchronizer.rs +103 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/push_manager.rs +86 -9
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/types.rs +23 -2
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/client/mod.rs +736 -116
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/client/reconnecting_connection.rs +69 -6
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/client/standalone_client.rs +191 -50
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/client/types.rs +164 -0
- valkey_glide_sync-2.3.0/glide-core/src/compression.rs +891 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/iam/mod.rs +66 -119
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/lib.rs +2 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/protobuf/command_request.proto +11 -2
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/protobuf/connection_request.proto +17 -1
- valkey_glide_sync-2.3.0/glide-core/src/pubsub/mock.rs +1313 -0
- valkey_glide_sync-2.3.0/glide-core/src/pubsub/mod.rs +70 -0
- valkey_glide_sync-2.3.0/glide-core/src/pubsub/synchronizer.rs +1076 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/request_type.rs +267 -2
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/socket_listener.rs +152 -4
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/telemetry/Cargo.toml +1 -0
- valkey_glide_sync-2.3.0/glide-core/telemetry/src/lib.rs +209 -0
- valkey_glide_sync-2.3.0/glide-core/telemetry/src/metrics_exporter_file.rs +307 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/telemetry/src/open_telemetry.rs +283 -50
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/__init__.py +19 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/batch.py +7 -7
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/json_batch.py +1 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/config.py +413 -31
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/constants.py +26 -1
- valkey_glide_sync-2.3.0/glide_shared/opentelemetry.py +100 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/__init__.py +28 -2
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/_glide_ffi.py +35 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/glide_client.py +183 -59
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/logger.py +1 -1
- valkey_glide_sync-2.3.0/glide_sync/opentelemetry.py +187 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/cluster_commands.py +94 -3
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/core.py +209 -11
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/glide_json.py +1 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/standalone_commands.py +1 -1
- valkey_glide_sync-2.3.0/glide_sync/sync_commands/utils.py +17 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/logger_core/src/lib.rs +5 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/pyproject.toml +1 -1
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/valkey_glide_sync.egg-info/PKG-INFO +182 -3
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/valkey_glide_sync.egg-info/SOURCES.txt +11 -2
- valkey_glide_sync-2.2.7/README.md +0 -189
- valkey_glide_sync-2.2.7/glide-core/README.md +0 -7
- valkey_glide_sync-2.2.7/glide-core/telemetry/src/lib.rs +0 -75
- valkey_glide_sync-2.2.7/glide-core/telemetry/src/metrics_exporter_file.rs +0 -247
- valkey_glide_sync-2.2.7/glide_sync/config.py +0 -197
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/MANIFEST.in +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/.cargo/config.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/.gitignore +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/.ort.yml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/DEVELOPER.md +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/README.md +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/cbindgen.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/README.md +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/cluster_scan_container.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/command_request.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/connection_request.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/errors.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/request_type.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/scripts_container.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-logger-core/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-logger-core/src/lib.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-redis/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-redis/src/cluster_routing.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-redis/src/cluster_topology.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-redis/src/lib.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-telemetry/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-tokio/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-tokio/src/lib.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-tokio/src/sync.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-tokio/src/task.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/rust-toolchain.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/.cargo/config.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/.ort.yml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/LICENSE +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/README.md +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/appveyor.yml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/get_command_info.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/CHANGELOG.md +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/LICENSE +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/examples/async-await.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/examples/async-multiplexed.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/examples/async-pub-sub.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/examples/async-scan.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/examples/basic.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/release.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/aio/connection.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/aio/connection_manager.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/aio/runtime.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/aio/tokio.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_async/LICENSE +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_async/connections_container.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_async/pipeline_routing.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/cluster_pipeline.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/commands/cluster_scan.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/commands/macros.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/commands/mod.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/macros.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/pipeline.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/retry_strategies.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/sentinel.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/redis/src/tls.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/rustfmt.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/redis-rs/src/main.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/client/value_conversion.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/cluster_scan_container.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/errors.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/protobuf/response.proto +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/rotating_buffer.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/src/scripts_container.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide-core/telemetry/src/span_exporter_file.rs +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/__init__.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/batch_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/bitmap.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/command_args.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/core_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/ft_options/ft_aggregate_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/ft_options/ft_constants.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/ft_options/ft_create_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/ft_options/ft_profile_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/ft_options/ft_search_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/server_modules/json_options.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/sorted_set.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/commands/stream.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/exceptions.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/protobuf_codec.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/py.typed +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_shared/routes.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/py.typed +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/__init__.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/cluster_scan_cursor.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/ft.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/glide_sync/sync_commands/script.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/logger_core/Cargo.toml +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/setup.cfg +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/setup.py +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/valkey_glide_sync.egg-info/dependency_links.txt +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/valkey_glide_sync.egg-info/requires.txt +0 -0
- {valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/valkey_glide_sync.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: valkey-glide-sync
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3.0
|
|
4
4
|
Summary: Valkey GLIDE Sync client. Supports Valkey and Redis OSS.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Classifier: Topic :: Database
|
|
@@ -31,8 +31,7 @@ Valkey General Language Independent Driver for the Enterprise (GLIDE) is the off
|
|
|
31
31
|
|
|
32
32
|
## Documentation
|
|
33
33
|
|
|
34
|
-
See GLIDE's [documentation site](https://valkey.io/
|
|
35
|
-
Visit our [wiki](https://github.com/valkey-io/valkey-glide/wiki/Python-wrapper) for examples and further details on TLS, Read strategy, Timeouts and various other configurations.
|
|
34
|
+
See GLIDE's Python [documentation site](https://glide.valkey.io/languages/python).
|
|
36
35
|
|
|
37
36
|
## Supported Engine Versions
|
|
38
37
|
|
|
@@ -192,6 +191,186 @@ test_standalone_client()
|
|
|
192
191
|
|
|
193
192
|
---
|
|
194
193
|
|
|
194
|
+
## PubSub Configuration
|
|
195
|
+
|
|
196
|
+
Valkey GLIDE supports dynamic PubSub with automatic subscription reconciliation. Configure the reconciliation interval to ensure subscriptions remain synchronized:
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
# Async client
|
|
200
|
+
from glide import GlideClientConfiguration, NodeAddress, GlideClient, AdvancedGlideClientConfiguration
|
|
201
|
+
|
|
202
|
+
config = GlideClientConfiguration(
|
|
203
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
204
|
+
advanced_config=AdvancedGlideClientConfiguration(
|
|
205
|
+
pubsub_reconciliation_interval=5000 # Reconcile every 5 seconds (in milliseconds)
|
|
206
|
+
)
|
|
207
|
+
)
|
|
208
|
+
client = await GlideClient.create(config)
|
|
209
|
+
|
|
210
|
+
# Sync client
|
|
211
|
+
from glide_sync import GlideClientConfiguration, NodeAddress, GlideClient, AdvancedGlideClientConfiguration
|
|
212
|
+
|
|
213
|
+
config = GlideClientConfiguration(
|
|
214
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
215
|
+
advanced_config=AdvancedGlideClientConfiguration(
|
|
216
|
+
pubsub_reconciliation_interval=5000 # Reconcile every 5 seconds (in milliseconds)
|
|
217
|
+
)
|
|
218
|
+
)
|
|
219
|
+
client = GlideClient.create(config)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Pre-configured Subscriptions
|
|
223
|
+
|
|
224
|
+
You can configure subscriptions at client creation time. The client will automatically establish these subscriptions during connection:
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
# Async client with pre-configured subscriptions
|
|
228
|
+
from glide import (
|
|
229
|
+
GlideClientConfiguration,
|
|
230
|
+
NodeAddress,
|
|
231
|
+
GlideClient,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
def message_callback(msg, context):
|
|
235
|
+
print(f"Received message on {msg.channel}: {msg.message}")
|
|
236
|
+
|
|
237
|
+
config = GlideClientConfiguration(
|
|
238
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
239
|
+
pubsub_subscriptions=GlideClientConfiguration.PubSubSubscriptions(
|
|
240
|
+
channels_and_patterns={
|
|
241
|
+
GlideClientConfiguration.PubSubChannelModes.Exact: {"news", "updates"},
|
|
242
|
+
GlideClientConfiguration.PubSubChannelModes.Pattern: {"events.*", "logs.*"},
|
|
243
|
+
},
|
|
244
|
+
callback=message_callback,
|
|
245
|
+
context=None # Optional context passed to callback
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
client = await GlideClient.create(config)
|
|
249
|
+
|
|
250
|
+
# Cluster client with sharded pubsub
|
|
251
|
+
from glide import GlideClusterClientConfiguration, GlideClusterClient
|
|
252
|
+
|
|
253
|
+
config = GlideClusterClientConfiguration(
|
|
254
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
255
|
+
pubsub_subscriptions=GlideClusterClientConfiguration.PubSubSubscriptions(
|
|
256
|
+
channels_and_patterns={
|
|
257
|
+
GlideClusterClientConfiguration.PubSubChannelModes.Exact: {"channel1"},
|
|
258
|
+
GlideClusterClientConfiguration.PubSubChannelModes.Pattern: {"pattern*"},
|
|
259
|
+
GlideClusterClientConfiguration.PubSubChannelModes.Sharded: {"shard_channel"},
|
|
260
|
+
},
|
|
261
|
+
callback=message_callback,
|
|
262
|
+
context=None
|
|
263
|
+
)
|
|
264
|
+
)
|
|
265
|
+
cluster_client = await GlideClusterClient.create(config)
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Dynamic Subscription Management
|
|
269
|
+
|
|
270
|
+
Subscribe and unsubscribe at runtime:
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
# Subscribe to channels
|
|
274
|
+
await client.subscribe({"channel1", "channel2"}, timeout_ms=5000)
|
|
275
|
+
|
|
276
|
+
# Subscribe to patterns
|
|
277
|
+
await client.psubscribe({"news.*", "events.*"}, timeout_ms=5000)
|
|
278
|
+
|
|
279
|
+
# Unsubscribe from specific channels
|
|
280
|
+
await client.unsubscribe({"channel1"}, timeout_ms=5000)
|
|
281
|
+
|
|
282
|
+
# Unsubscribe from all channels
|
|
283
|
+
from glide.async_commands.core import ALL_CHANNELS
|
|
284
|
+
await client.unsubscribe(ALL_CHANNELS, timeout_ms=5000)
|
|
285
|
+
|
|
286
|
+
# Unsubscribe from all patterns
|
|
287
|
+
from glide.async_commands.core import ALL_PATTERNS
|
|
288
|
+
await client.punsubscribe(ALL_PATTERNS, timeout_ms=5000)
|
|
289
|
+
|
|
290
|
+
# Cluster: sharded pubsub
|
|
291
|
+
await cluster_client.ssubscribe({"shard_channel"}, timeout_ms=5000)
|
|
292
|
+
await cluster_client.sunsubscribe({"shard_channel"}, timeout_ms=5000)
|
|
293
|
+
|
|
294
|
+
# Check subscription state
|
|
295
|
+
state = await client.get_subscriptions()
|
|
296
|
+
print(f"Desired: {state.desired_subscriptions}")
|
|
297
|
+
print(f"Actual: {state.actual_subscriptions}")
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Client Statistics
|
|
301
|
+
|
|
302
|
+
Monitor client performance and subscription health using `get_statistics()`:
|
|
303
|
+
|
|
304
|
+
```python
|
|
305
|
+
stats = await client.get_statistics() # Async
|
|
306
|
+
# or
|
|
307
|
+
stats = client.get_statistics() # Sync
|
|
308
|
+
|
|
309
|
+
# Available metrics:
|
|
310
|
+
# - total_connections: Number of active connections
|
|
311
|
+
# - total_clients: Number of client instances
|
|
312
|
+
# - total_values_compressed: Count of compressed values
|
|
313
|
+
# - total_values_decompressed: Count of decompressed values
|
|
314
|
+
# - total_original_bytes: Original data size before compression
|
|
315
|
+
# - total_bytes_compressed: Compressed data size
|
|
316
|
+
# - total_bytes_decompressed: Decompressed data size
|
|
317
|
+
# - compression_skipped_count: Times compression was skipped
|
|
318
|
+
# - subscription_out_of_sync_count: Failed reconciliation attempts
|
|
319
|
+
# - subscription_last_sync_timestamp: Last successful sync (milliseconds since epoch)
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## OpenTelemetry Configuration
|
|
325
|
+
|
|
326
|
+
Valkey GLIDE supports OpenTelemetry for distributed tracing and metrics collection. This allows you to monitor command execution, measure latency, and track performance across your application.
|
|
327
|
+
|
|
328
|
+
### Basic OpenTelemetry Setup
|
|
329
|
+
|
|
330
|
+
Both async and sync clients support OpenTelemetry configuration:
|
|
331
|
+
|
|
332
|
+
```python
|
|
333
|
+
# Async client
|
|
334
|
+
from glide import OpenTelemetry, OpenTelemetryConfig, OpenTelemetryTracesConfig, OpenTelemetryMetricsConfig
|
|
335
|
+
|
|
336
|
+
# Sync client
|
|
337
|
+
from glide_sync import OpenTelemetry, OpenTelemetryConfig, OpenTelemetryTracesConfig, OpenTelemetryMetricsConfig
|
|
338
|
+
|
|
339
|
+
# Initialize OpenTelemetry (once per process)
|
|
340
|
+
OpenTelemetry.init(OpenTelemetryConfig(
|
|
341
|
+
traces=OpenTelemetryTracesConfig(
|
|
342
|
+
endpoint="http://localhost:4318/v1/traces", # OTLP HTTP endpoint
|
|
343
|
+
sample_percentage=1 # Sample 1% of requests (default)
|
|
344
|
+
),
|
|
345
|
+
metrics=OpenTelemetryMetricsConfig(
|
|
346
|
+
endpoint="http://localhost:4318/v1/metrics"
|
|
347
|
+
),
|
|
348
|
+
flush_interval_ms=5000 # Flush every 5 seconds (default)
|
|
349
|
+
))
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### Supported Endpoints
|
|
353
|
+
|
|
354
|
+
- **HTTP/HTTPS**: `http://localhost:4318/v1/traces` or `https://...`
|
|
355
|
+
- **gRPC**: `grpc://localhost:4317`
|
|
356
|
+
- **File**: `file:///tmp/traces.json` (for local testing)
|
|
357
|
+
|
|
358
|
+
### Runtime Configuration
|
|
359
|
+
|
|
360
|
+
You can adjust the sampling percentage at runtime:
|
|
361
|
+
|
|
362
|
+
```python
|
|
363
|
+
# Change sampling to 10%
|
|
364
|
+
OpenTelemetry.set_sample_percentage(10)
|
|
365
|
+
|
|
366
|
+
# Check current sampling rate
|
|
367
|
+
current_rate = OpenTelemetry.get_sample_percentage()
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
**Note**: OpenTelemetry can only be initialized once per process. To change configuration, restart your application.
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
195
374
|
For complete examples with error handling, please refer to:
|
|
196
375
|
- [Async Cluster Example](https://github.com/valkey-io/valkey-glide/blob/main/examples/python/cluster_example.py)
|
|
197
376
|
- [Async Standalone Example](https://github.com/valkey-io/valkey-glide/blob/main/examples/python/standalone_example.py)
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
# Welcome to Valkey GLIDE!
|
|
2
|
+
|
|
3
|
+
Valkey General Language Independent Driver for the Enterprise (GLIDE) is the official open-source Valkey client library, proudly part of the Valkey organization. Our mission is to make your experience with Valkey and Redis OSS seamless and enjoyable. Whether you're a seasoned developer or just starting out, Valkey GLIDE is here to support you every step of the way.
|
|
4
|
+
|
|
5
|
+
# Why Choose Valkey GLIDE?
|
|
6
|
+
|
|
7
|
+
- **Community and Open Source**: Join our vibrant community and contribute to the project. We are always here to respond, and the client is for the community.
|
|
8
|
+
- **Reliability**: Built with best practices learned from over a decade of operating Redis OSS-compatible services.
|
|
9
|
+
- **Performance**: Optimized for high performance and low latency.
|
|
10
|
+
- **High Availability**: Designed to ensure your applications are always up and running.
|
|
11
|
+
- **Cross-Language Support**: Implemented using a core driver framework written in Rust, with language-specific extensions to ensure consistency and reduce complexity.
|
|
12
|
+
- **Stability and Fault Tolerance**: We brought our years of experience to create a bulletproof client.
|
|
13
|
+
- **Backed and Supported by AWS and GCP**: Ensuring robust support and continuous improvement of the project.
|
|
14
|
+
|
|
15
|
+
## Documentation
|
|
16
|
+
|
|
17
|
+
See GLIDE's Python [documentation site](https://glide.valkey.io/languages/python).
|
|
18
|
+
|
|
19
|
+
## Supported Engine Versions
|
|
20
|
+
|
|
21
|
+
Refer to the [Supported Engine Versions table](https://github.com/valkey-io/valkey-glide/blob/main/README.md#supported-engine-versions) for details.
|
|
22
|
+
|
|
23
|
+
# Getting Started - Python Wrapper
|
|
24
|
+
|
|
25
|
+
## System Requirements
|
|
26
|
+
|
|
27
|
+
The release of Valkey GLIDE was tested on the following platforms:
|
|
28
|
+
|
|
29
|
+
Linux:
|
|
30
|
+
|
|
31
|
+
- Ubuntu 20 (x86_64/amd64 and arm64/aarch64)
|
|
32
|
+
- Amazon Linux 2 (AL2) and 2023 (AL2023) (x86_64)
|
|
33
|
+
|
|
34
|
+
**Note: Currently Alpine Linux / MUSL is NOT supported.**
|
|
35
|
+
|
|
36
|
+
macOS:
|
|
37
|
+
|
|
38
|
+
- macOS 14.7 (Apple silicon/aarch_64)
|
|
39
|
+
- macOS 13.7 (x86_64/amd64)
|
|
40
|
+
|
|
41
|
+
## Python Supported Versions
|
|
42
|
+
|
|
43
|
+
| Python Version |
|
|
44
|
+
|----------------|
|
|
45
|
+
| 3.9 |
|
|
46
|
+
| 3.10 |
|
|
47
|
+
| 3.11 |
|
|
48
|
+
| 3.12 |
|
|
49
|
+
| 3.13 |
|
|
50
|
+
|
|
51
|
+
Valkey GLIDE transparently supports both the `asyncio` and `trio` concurrency frameworks.
|
|
52
|
+
|
|
53
|
+
## Installation and Setup
|
|
54
|
+
|
|
55
|
+
### ✅ Async Client
|
|
56
|
+
|
|
57
|
+
To install the async version:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install valkey-glide
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Verify installation:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python3
|
|
67
|
+
>>> import glide
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### ✅ Sync Client
|
|
71
|
+
|
|
72
|
+
To install the sync version:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install valkey-glide-sync
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Verify installation:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
python3
|
|
82
|
+
>>> import glide_sync
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Basic Examples
|
|
88
|
+
|
|
89
|
+
### 🔁 Async Client
|
|
90
|
+
|
|
91
|
+
### ✅ Async Cluster Mode
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import asyncio
|
|
95
|
+
from glide import GlideClusterClientConfiguration, NodeAddress, GlideClusterClient
|
|
96
|
+
|
|
97
|
+
async def test_cluster_client():
|
|
98
|
+
addresses = [NodeAddress("address.example.com", 6379)]
|
|
99
|
+
# It is recommended to set a timeout for your specific use case
|
|
100
|
+
config = GlideClusterClientConfiguration(addresses, request_timeout=500) # 500ms timeout
|
|
101
|
+
client = await GlideClusterClient.create(config)
|
|
102
|
+
set_result = await client.set("foo", "bar")
|
|
103
|
+
print(f"Set response is {set_result}")
|
|
104
|
+
get_result = await client.get("foo")
|
|
105
|
+
print(f"Get response is {get_result}")
|
|
106
|
+
|
|
107
|
+
asyncio.run(test_cluster_client())
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### ✅ Async Standalone Mode
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import asyncio
|
|
114
|
+
from glide import GlideClientConfiguration, NodeAddress, GlideClient
|
|
115
|
+
|
|
116
|
+
async def test_standalone_client():
|
|
117
|
+
addresses = [
|
|
118
|
+
NodeAddress("server_primary.example.com", 6379),
|
|
119
|
+
NodeAddress("server_replica.example.com", 6379)
|
|
120
|
+
]
|
|
121
|
+
# It is recommended to set a timeout for your specific use case
|
|
122
|
+
config = GlideClientConfiguration(addresses, request_timeout=500) # 500ms timeout
|
|
123
|
+
client = await GlideClient.create(config)
|
|
124
|
+
set_result = await client.set("foo", "bar")
|
|
125
|
+
print(f"Set response is {set_result}")
|
|
126
|
+
get_result = await client.get("foo")
|
|
127
|
+
print(f"Get response is {get_result}")
|
|
128
|
+
|
|
129
|
+
asyncio.run(test_standalone_client())
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
### 🔂 Sync Client
|
|
135
|
+
|
|
136
|
+
#### ✅ Sync Cluster Mode
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
from glide_sync import GlideClusterClientConfiguration, NodeAddress, GlideClusterClient
|
|
140
|
+
|
|
141
|
+
def test_cluster_client():
|
|
142
|
+
addresses = [NodeAddress("address.example.com", 6379)]
|
|
143
|
+
# It is recommended to set a timeout for your specific use case
|
|
144
|
+
config = GlideClusterClientConfiguration(addresses, request_timeout=500) # 500ms timeout
|
|
145
|
+
client = GlideClusterClient.create(config)
|
|
146
|
+
set_result = client.set("foo", "bar")
|
|
147
|
+
print(f"Set response is {set_result}")
|
|
148
|
+
get_result = client.get("foo")
|
|
149
|
+
print(f"Get response is {get_result}")
|
|
150
|
+
|
|
151
|
+
test_cluster_client()
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### ✅ Sync Standalone Mode
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
from glide_sync import GlideClientConfiguration, NodeAddress, GlideClient
|
|
158
|
+
|
|
159
|
+
def test_standalone_client():
|
|
160
|
+
addresses = [
|
|
161
|
+
NodeAddress("server_primary.example.com", 6379),
|
|
162
|
+
NodeAddress("server_replica.example.com", 6379)
|
|
163
|
+
]
|
|
164
|
+
# It is recommended to set a timeout for your specific use case
|
|
165
|
+
config = GlideClientConfiguration(addresses, request_timeout=500) # 500ms timeout
|
|
166
|
+
client = GlideClient.create(config)
|
|
167
|
+
set_result = client.set("foo", "bar")
|
|
168
|
+
print(f"Set response is {set_result}")
|
|
169
|
+
get_result = client.get("foo")
|
|
170
|
+
print(f"Get response is {get_result}")
|
|
171
|
+
|
|
172
|
+
test_standalone_client()
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## PubSub Configuration
|
|
178
|
+
|
|
179
|
+
Valkey GLIDE supports dynamic PubSub with automatic subscription reconciliation. Configure the reconciliation interval to ensure subscriptions remain synchronized:
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
# Async client
|
|
183
|
+
from glide import GlideClientConfiguration, NodeAddress, GlideClient, AdvancedGlideClientConfiguration
|
|
184
|
+
|
|
185
|
+
config = GlideClientConfiguration(
|
|
186
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
187
|
+
advanced_config=AdvancedGlideClientConfiguration(
|
|
188
|
+
pubsub_reconciliation_interval=5000 # Reconcile every 5 seconds (in milliseconds)
|
|
189
|
+
)
|
|
190
|
+
)
|
|
191
|
+
client = await GlideClient.create(config)
|
|
192
|
+
|
|
193
|
+
# Sync client
|
|
194
|
+
from glide_sync import GlideClientConfiguration, NodeAddress, GlideClient, AdvancedGlideClientConfiguration
|
|
195
|
+
|
|
196
|
+
config = GlideClientConfiguration(
|
|
197
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
198
|
+
advanced_config=AdvancedGlideClientConfiguration(
|
|
199
|
+
pubsub_reconciliation_interval=5000 # Reconcile every 5 seconds (in milliseconds)
|
|
200
|
+
)
|
|
201
|
+
)
|
|
202
|
+
client = GlideClient.create(config)
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Pre-configured Subscriptions
|
|
206
|
+
|
|
207
|
+
You can configure subscriptions at client creation time. The client will automatically establish these subscriptions during connection:
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
# Async client with pre-configured subscriptions
|
|
211
|
+
from glide import (
|
|
212
|
+
GlideClientConfiguration,
|
|
213
|
+
NodeAddress,
|
|
214
|
+
GlideClient,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
def message_callback(msg, context):
|
|
218
|
+
print(f"Received message on {msg.channel}: {msg.message}")
|
|
219
|
+
|
|
220
|
+
config = GlideClientConfiguration(
|
|
221
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
222
|
+
pubsub_subscriptions=GlideClientConfiguration.PubSubSubscriptions(
|
|
223
|
+
channels_and_patterns={
|
|
224
|
+
GlideClientConfiguration.PubSubChannelModes.Exact: {"news", "updates"},
|
|
225
|
+
GlideClientConfiguration.PubSubChannelModes.Pattern: {"events.*", "logs.*"},
|
|
226
|
+
},
|
|
227
|
+
callback=message_callback,
|
|
228
|
+
context=None # Optional context passed to callback
|
|
229
|
+
)
|
|
230
|
+
)
|
|
231
|
+
client = await GlideClient.create(config)
|
|
232
|
+
|
|
233
|
+
# Cluster client with sharded pubsub
|
|
234
|
+
from glide import GlideClusterClientConfiguration, GlideClusterClient
|
|
235
|
+
|
|
236
|
+
config = GlideClusterClientConfiguration(
|
|
237
|
+
addresses=[NodeAddress("localhost", 6379)],
|
|
238
|
+
pubsub_subscriptions=GlideClusterClientConfiguration.PubSubSubscriptions(
|
|
239
|
+
channels_and_patterns={
|
|
240
|
+
GlideClusterClientConfiguration.PubSubChannelModes.Exact: {"channel1"},
|
|
241
|
+
GlideClusterClientConfiguration.PubSubChannelModes.Pattern: {"pattern*"},
|
|
242
|
+
GlideClusterClientConfiguration.PubSubChannelModes.Sharded: {"shard_channel"},
|
|
243
|
+
},
|
|
244
|
+
callback=message_callback,
|
|
245
|
+
context=None
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
cluster_client = await GlideClusterClient.create(config)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Dynamic Subscription Management
|
|
252
|
+
|
|
253
|
+
Subscribe and unsubscribe at runtime:
|
|
254
|
+
|
|
255
|
+
```python
|
|
256
|
+
# Subscribe to channels
|
|
257
|
+
await client.subscribe({"channel1", "channel2"}, timeout_ms=5000)
|
|
258
|
+
|
|
259
|
+
# Subscribe to patterns
|
|
260
|
+
await client.psubscribe({"news.*", "events.*"}, timeout_ms=5000)
|
|
261
|
+
|
|
262
|
+
# Unsubscribe from specific channels
|
|
263
|
+
await client.unsubscribe({"channel1"}, timeout_ms=5000)
|
|
264
|
+
|
|
265
|
+
# Unsubscribe from all channels
|
|
266
|
+
from glide.async_commands.core import ALL_CHANNELS
|
|
267
|
+
await client.unsubscribe(ALL_CHANNELS, timeout_ms=5000)
|
|
268
|
+
|
|
269
|
+
# Unsubscribe from all patterns
|
|
270
|
+
from glide.async_commands.core import ALL_PATTERNS
|
|
271
|
+
await client.punsubscribe(ALL_PATTERNS, timeout_ms=5000)
|
|
272
|
+
|
|
273
|
+
# Cluster: sharded pubsub
|
|
274
|
+
await cluster_client.ssubscribe({"shard_channel"}, timeout_ms=5000)
|
|
275
|
+
await cluster_client.sunsubscribe({"shard_channel"}, timeout_ms=5000)
|
|
276
|
+
|
|
277
|
+
# Check subscription state
|
|
278
|
+
state = await client.get_subscriptions()
|
|
279
|
+
print(f"Desired: {state.desired_subscriptions}")
|
|
280
|
+
print(f"Actual: {state.actual_subscriptions}")
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Client Statistics
|
|
284
|
+
|
|
285
|
+
Monitor client performance and subscription health using `get_statistics()`:
|
|
286
|
+
|
|
287
|
+
```python
|
|
288
|
+
stats = await client.get_statistics() # Async
|
|
289
|
+
# or
|
|
290
|
+
stats = client.get_statistics() # Sync
|
|
291
|
+
|
|
292
|
+
# Available metrics:
|
|
293
|
+
# - total_connections: Number of active connections
|
|
294
|
+
# - total_clients: Number of client instances
|
|
295
|
+
# - total_values_compressed: Count of compressed values
|
|
296
|
+
# - total_values_decompressed: Count of decompressed values
|
|
297
|
+
# - total_original_bytes: Original data size before compression
|
|
298
|
+
# - total_bytes_compressed: Compressed data size
|
|
299
|
+
# - total_bytes_decompressed: Decompressed data size
|
|
300
|
+
# - compression_skipped_count: Times compression was skipped
|
|
301
|
+
# - subscription_out_of_sync_count: Failed reconciliation attempts
|
|
302
|
+
# - subscription_last_sync_timestamp: Last successful sync (milliseconds since epoch)
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## OpenTelemetry Configuration
|
|
308
|
+
|
|
309
|
+
Valkey GLIDE supports OpenTelemetry for distributed tracing and metrics collection. This allows you to monitor command execution, measure latency, and track performance across your application.
|
|
310
|
+
|
|
311
|
+
### Basic OpenTelemetry Setup
|
|
312
|
+
|
|
313
|
+
Both async and sync clients support OpenTelemetry configuration:
|
|
314
|
+
|
|
315
|
+
```python
|
|
316
|
+
# Async client
|
|
317
|
+
from glide import OpenTelemetry, OpenTelemetryConfig, OpenTelemetryTracesConfig, OpenTelemetryMetricsConfig
|
|
318
|
+
|
|
319
|
+
# Sync client
|
|
320
|
+
from glide_sync import OpenTelemetry, OpenTelemetryConfig, OpenTelemetryTracesConfig, OpenTelemetryMetricsConfig
|
|
321
|
+
|
|
322
|
+
# Initialize OpenTelemetry (once per process)
|
|
323
|
+
OpenTelemetry.init(OpenTelemetryConfig(
|
|
324
|
+
traces=OpenTelemetryTracesConfig(
|
|
325
|
+
endpoint="http://localhost:4318/v1/traces", # OTLP HTTP endpoint
|
|
326
|
+
sample_percentage=1 # Sample 1% of requests (default)
|
|
327
|
+
),
|
|
328
|
+
metrics=OpenTelemetryMetricsConfig(
|
|
329
|
+
endpoint="http://localhost:4318/v1/metrics"
|
|
330
|
+
),
|
|
331
|
+
flush_interval_ms=5000 # Flush every 5 seconds (default)
|
|
332
|
+
))
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Supported Endpoints
|
|
336
|
+
|
|
337
|
+
- **HTTP/HTTPS**: `http://localhost:4318/v1/traces` or `https://...`
|
|
338
|
+
- **gRPC**: `grpc://localhost:4317`
|
|
339
|
+
- **File**: `file:///tmp/traces.json` (for local testing)
|
|
340
|
+
|
|
341
|
+
### Runtime Configuration
|
|
342
|
+
|
|
343
|
+
You can adjust the sampling percentage at runtime:
|
|
344
|
+
|
|
345
|
+
```python
|
|
346
|
+
# Change sampling to 10%
|
|
347
|
+
OpenTelemetry.set_sample_percentage(10)
|
|
348
|
+
|
|
349
|
+
# Check current sampling rate
|
|
350
|
+
current_rate = OpenTelemetry.get_sample_percentage()
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**Note**: OpenTelemetry can only be initialized once per process. To change configuration, restart your application.
|
|
354
|
+
|
|
355
|
+
---
|
|
356
|
+
|
|
357
|
+
For complete examples with error handling, please refer to:
|
|
358
|
+
- [Async Cluster Example](https://github.com/valkey-io/valkey-glide/blob/main/examples/python/cluster_example.py)
|
|
359
|
+
- [Async Standalone Example](https://github.com/valkey-io/valkey-glide/blob/main/examples/python/standalone_example.py)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
### Building & Testing
|
|
363
|
+
|
|
364
|
+
Development instructions for local building & testing the package are in the [DEVELOPER.md](https://github.com/valkey-io/valkey-glide/blob/main/python/DEVELOPER.md#build-from-source) file.
|
|
365
|
+
|
|
366
|
+
## Community and Feedback
|
|
367
|
+
|
|
368
|
+
We encourage you to join our community to support, share feedback, and ask questions. You can approach us for anything on our Valkey Slack: [Join Valkey Slack](https://join.slack.com/t/valkey-oss-developer/shared_invite/zt-2nxs51chx-EB9hu9Qdch3GMfRcztTSkQ).
|
{valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/client.rs
RENAMED
|
@@ -87,4 +87,19 @@ impl Client {
|
|
|
87
87
|
pub async fn refresh_iam_token(&mut self) -> RedisResult<()> {
|
|
88
88
|
todo!()
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
/// Mock compression_manager method for Miri tests
|
|
92
|
+
pub fn compression_manager(&self) -> Option<std::sync::Arc<crate::compression::CompressionManager>> {
|
|
93
|
+
None
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/// Mock reserve_inflight_request method for Miri tests
|
|
97
|
+
pub fn reserve_inflight_request(&self) -> bool {
|
|
98
|
+
true // Always allow in mock
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/// Mock release_inflight_request method for Miri tests
|
|
102
|
+
pub fn release_inflight_request(&self) -> isize {
|
|
103
|
+
0 // No-op in mock
|
|
104
|
+
}
|
|
90
105
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0
|
|
2
|
+
|
|
3
|
+
//! Mock compression module for Miri tests
|
|
4
|
+
|
|
5
|
+
use crate::request_type::RequestType;
|
|
6
|
+
|
|
7
|
+
/// Re-export the minimum compressed size constant from glide-core
|
|
8
|
+
pub use glide_core::compression::MIN_COMPRESSED_SIZE;
|
|
9
|
+
|
|
10
|
+
/// Mock compression manager
|
|
11
|
+
#[derive(Debug)]
|
|
12
|
+
pub struct CompressionManager;
|
|
13
|
+
|
|
14
|
+
impl CompressionManager {
|
|
15
|
+
/// Mock compression method - does nothing
|
|
16
|
+
pub fn compress(&self, _data: &[u8]) -> Result<Vec<u8>, String> {
|
|
17
|
+
Ok(Vec::new())
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Mock decompression method - does nothing
|
|
21
|
+
pub fn decompress(&self, _data: &[u8]) -> Result<Vec<u8>, String> {
|
|
22
|
+
Ok(Vec::new())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// Mock is_enabled method - always returns false
|
|
26
|
+
pub fn is_enabled(&self) -> bool {
|
|
27
|
+
false
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/// Mock function to process command args for compression
|
|
32
|
+
/// In Miri tests, this is a no-op
|
|
33
|
+
pub fn process_command_args_for_compression(
|
|
34
|
+
_args: &mut [Vec<u8>],
|
|
35
|
+
_request_type: RequestType,
|
|
36
|
+
_compression_manager: Option<&CompressionManager>,
|
|
37
|
+
) -> Result<(), String> {
|
|
38
|
+
Ok(())
|
|
39
|
+
}
|
{valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-glide-core/src/lib.rs
RENAMED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
pub mod client;
|
|
4
4
|
pub mod cluster_scan_container;
|
|
5
5
|
pub mod command_request;
|
|
6
|
+
pub mod compression;
|
|
6
7
|
pub mod connection_request;
|
|
7
8
|
pub mod errors;
|
|
8
9
|
pub mod request_type;
|
|
@@ -11,6 +12,7 @@ pub mod scripts_container;
|
|
|
11
12
|
pub use client::*;
|
|
12
13
|
pub use cluster_scan_container::*;
|
|
13
14
|
pub use command_request::*;
|
|
15
|
+
pub use compression::*;
|
|
14
16
|
pub use connection_request::*;
|
|
15
17
|
pub use errors::*;
|
|
16
18
|
pub use request_type::*;
|
{valkey_glide_sync-2.2.7 → valkey_glide_sync-2.3.0}/ffi/miri-tests/mock-telemetry/src/lib.rs
RENAMED
|
@@ -101,3 +101,34 @@ impl fmt::Display for GlideOTELError {
|
|
|
101
101
|
write!(f, "error")
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
|
|
105
|
+
/// Mock Telemetry struct for Miri tests
|
|
106
|
+
pub struct Telemetry;
|
|
107
|
+
|
|
108
|
+
impl Telemetry {
|
|
109
|
+
pub fn incr_total_connections(_incr_by: usize) -> usize { 0 }
|
|
110
|
+
pub fn decr_total_connections(_decr_by: usize) -> usize { 0 }
|
|
111
|
+
pub fn incr_total_clients(_incr_by: usize) -> usize { 0 }
|
|
112
|
+
pub fn decr_total_clients(_decr_by: usize) -> usize { 0 }
|
|
113
|
+
pub fn total_connections() -> usize { 0 }
|
|
114
|
+
pub fn total_clients() -> usize { 0 }
|
|
115
|
+
pub fn incr_total_values_compressed(_incr_by: usize) -> usize { 0 }
|
|
116
|
+
pub fn total_values_compressed() -> usize { 0 }
|
|
117
|
+
pub fn incr_total_values_decompressed(_incr_by: usize) -> usize { 0 }
|
|
118
|
+
pub fn total_values_decompressed() -> usize { 0 }
|
|
119
|
+
pub fn incr_total_original_bytes(_incr_by: usize) -> usize { 0 }
|
|
120
|
+
pub fn total_original_bytes() -> usize { 0 }
|
|
121
|
+
pub fn incr_total_bytes_compressed(_incr_by: usize) -> usize { 0 }
|
|
122
|
+
pub fn total_bytes_compressed() -> usize { 0 }
|
|
123
|
+
pub fn incr_total_bytes_decompressed(_incr_by: usize) -> usize { 0 }
|
|
124
|
+
pub fn total_bytes_decompressed() -> usize { 0 }
|
|
125
|
+
pub fn incr_compression_skipped_count(_incr_by: usize) -> usize { 0 }
|
|
126
|
+
pub fn compression_skipped_count() -> usize { 0 }
|
|
127
|
+
pub fn incr_subscription_out_of_sync() -> usize { 0 }
|
|
128
|
+
pub fn subscription_out_of_sync_count() -> usize { 0 }
|
|
129
|
+
pub fn update_subscription_last_sync_timestamp(_timestamp: u64) -> u64 { 0 }
|
|
130
|
+
pub fn subscription_last_sync_timestamp() -> u64 { 0 }
|
|
131
|
+
pub fn reset() {}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
pub const DEFAULT_FLUSH_SIGNAL_INTERVAL_MS: u32 = 0;
|