You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`RedisCacheStrategy`: Cache the data in Redis (Sync only).
94
+
95
+
To cache the data in Redis (Sync only), you need to provide a redis client to the `RedisCacheStrategy`. For example:
96
+
97
+
```python
98
+
from redis import Redis
99
+
100
+
github = GitHub(
101
+
cache_strategy=RedisCacheStrategy(
102
+
client=Redis(host="localhost", port=6379)
103
+
)
104
+
)
105
+
```
106
+
107
+
Note that using this sync only cache strategy will cause the `GitHub` instance to be sync only.
108
+
81
109
-`AsyncRedisCacheStrategy`: Cache the data in Redis (Async only).
82
110
111
+
To cache the data in Redis (Async only), you need to provide an async redis client to the `AsyncRedisCacheStrategy`. For example:
112
+
113
+
```python
114
+
from redis.asyncio import Redis
115
+
116
+
github = GitHub(
117
+
cache_strategy=AsyncRedisCacheStrategy(
118
+
client=Redis(host="localhost", port=6379)
119
+
)
120
+
)
121
+
```
122
+
123
+
Note that using this async only cache strategy will cause the `GitHub` instance to be async only.
124
+
83
125
### `http_cache`
84
126
85
127
The `http_cache` option enables the http caching feature powered by [Hishel](https://hishel.com/) for HTTPX. GitHub API limits the number of requests that you can make within a specific amount of time. This feature is useful to reduce the number of requests to GitHub API and avoid hitting the rate limit.
@@ -92,6 +134,12 @@ Available built-in throttlers:
92
134
93
135
-`LocalThrottler`: Control the request concurrency in the local process / event loop.
94
136
137
+
```python
138
+
from githubkit.throttling import LocalThrottler
139
+
140
+
github = GitHub(throttler=LocalThrottler(100))
141
+
```
142
+
95
143
### `auto_retry`
96
144
97
145
The `auto_retry` option enables request retrying when rate limit exceeded and server error encountered. See [Auto Retry](./auto-retry.md) for more infomation.
0 commit comments