glide
ClusterScanCursor
Bases: ClusterScanCursor
ClusterScanCursor using the async package's FFI instance.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/_ffi_wrappers.py
19 20 21 22 23 | |
Script
Bases: Script
Script using the async package's FFI instance.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/_ffi_wrappers.py
12 13 14 15 16 | |
AsyncClientPool
FFI-based async client pool. Same Rust pool as all other languages.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | |
create(client_config, pool_config=None)
async
classmethod
Create a pool and validate connectivity with a probe client.
Creates the pool infrastructure, then attempts to connect a single probe client using the same config. If the probe fails, the pool is destroyed and the actual connection error is propagated (not a timeout).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client_config
|
BaseClientConfiguration
|
Client configuration (standalone or cluster). |
required |
pool_config
|
Optional[PoolConfig]
|
Optional pool sizing/timeout configuration. |
None
|
Returns:
| Type | Description |
|---|---|
AsyncClientPool
|
A ready-to-use AsyncClientPool instance. |
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
acquire(timeout=None)
async
Acquire a client_id using non-blocking try_acquire with async backoff.
Uses glide_pool_try_acquire (non-blocking) instead of glide_pool_acquire_blocking to avoid blocking thread pool threads. Blocking threads prevents the event loop from draining the async pipe, which deadlocks the pool's release state-reset (DISCARD + SELECT).
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
release(client_id)
Release a borrowed client back to the pool.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
224 225 226 | |
borrow(timeout=None)
Async context manager.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
228 229 230 | |
metrics()
Get pool metrics: idle, active, total counts.
Zeros when the pool was destroyed.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
290 291 292 293 294 295 296 | |
PoolConfig
dataclass
Configuration for the async client-instance pool.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/client_pool.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
abandon_timeout_ms = 300000
class-attribute
instance-attribute
Maximum inactivity time for a borrowed client before the pool reclaims it (ms). The timer resets on every command sent. The abandon monitor skips clients executing blocking commands (BLPOP, XREAD BLOCK, etc.). Set to 0 to disable abandon detection. Default: 5 minutes.
GlideClient
Bases: BaseClient, StandaloneCommands
Client used for connection to standalone servers.
Use :func:~BaseClient.create to request a client.
For full documentation, see
Valkey GLIDE Documentation
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/glide_client.py
1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 | |
GlideClusterClient
Bases: BaseClient, ClusterCommands
Client used for connection to cluster servers.
Use :func:~BaseClient.create to request a client.
For full documentation, see
Valkey GLIDE Documentation
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/glide_client.py
1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 | |
AsyncIsolatedScope
Async wrapper around a dedicated scoped connection.
Commands are dispatched to a thread pool executor (since the underlying FFI call blocks on Tokio), keeping the asyncio event loop free.
Thread Safety: A single AsyncIsolatedScope should only be used from one coroutine at a time. Multiple coroutines should each acquire their own scope.
Use as an async context manager
async with client.scoped_connection() as scope: await scope.watch("key") ...
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
watch(*keys)
async
WATCH one or more keys for optimistic locking.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
87 88 89 | |
unwatch()
async
Discard all watched keys.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
91 92 93 | |
multi()
async
Begin a transaction block.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
95 96 97 | |
exec()
async
Execute the transaction (returns None if WATCH detected a conflict).
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
99 100 101 | |
discard()
async
Discard the transaction.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
103 104 105 | |
get(key)
async
GET a key value.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
107 108 109 | |
set(key, value)
async
SET a key to a value.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
111 112 113 | |
incr(key)
async
Increment a key's integer value by 1.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
115 116 117 | |
ping(message=None)
async
PING the server.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
119 120 121 122 123 | |
select(db)
async
SELECT a database by index.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
125 126 127 | |
execute_command(command, *args)
async
Execute an arbitrary command on this scope.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
129 130 131 | |
close()
async
Release the scope back to the pool.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/isolated_scope.py
196 197 198 199 200 | |
MonitorClient
An async client that streams all commands processed by the server via MONITOR.
Must be used with a standalone (non-cluster) configuration.
The configuration's lib_name and client_info_tag identify the dedicated
monitor connection, using GlidePy as the default library name.
Supports both asyncio and trio backends via anyio.
Warning: MONITOR is a debugging tool with performance implications. Do not use in production environments.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/monitor_client.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
create(config, callback=None)
async
classmethod
Create a new async MonitorClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
GlideClientConfiguration
|
Standalone client configuration (must be GlideClientConfiguration). Its library-name override and client information tag are applied to the dedicated monitor connection. |
required |
callback
|
Optional[Callable[[MonitorMsg], None]]
|
Optional sync callback invoked for each MonitorMsg. If None, messages are queued for get_monitor_message(). |
None
|
Returns:
| Type | Description |
|---|---|
MonitorClient
|
A MonitorClient instance. |
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/monitor_client.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
get_monitor_message()
async
Wait for and return the next MonitorMsg.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/monitor_client.py
186 187 188 189 190 191 192 | |
try_get_monitor_message()
Non-blocking retrieval. Returns None if queue is empty.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/monitor_client.py
194 195 196 197 198 199 200 201 202 203 204 205 206 | |
stop()
async
Stop monitoring and release resources.
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/monitor_client.py
208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
aclose()
async
Alias for stop().
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/monitor_client.py
223 224 225 | |
OpenTelemetry
Bases: OpenTelemetry
Async client OpenTelemetry singleton (separate from sync).
Source code in doc-gen/valkey-glide/python/glide-async/python/glide/opentelemetry.py
11 12 13 14 15 | |