File tree Expand file tree Collapse file tree 6 files changed +18
-18
lines changed
packages/nextjs-cache-handler Expand file tree Collapse file tree 6 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -130,10 +130,10 @@ const redisHandler = await createRedisHandler({
130
130
``` js
131
131
import { createCluster } from " @redis/client" ;
132
132
import createRedisHandler from " @fortedigital/nextjs-cache-handler/redis-strings" ;
133
- import { withProxy } from " @fortedigital/nextjs-cache-handler/cluster/proxy " ;
133
+ import { withAdapter } from " @fortedigital/nextjs-cache-handler/cluster/adapter " ;
134
134
135
135
const { hostname: redisHostName } = new URL (process .env .REDIS_URL );
136
- redis = withProxy (
136
+ redis = withAdapter (
137
137
createCluster ({
138
138
rootNodes: [{ url: process .env .REDIS_URL }],
139
139
@@ -149,7 +149,7 @@ redis = withProxy(
149
149
})
150
150
);
151
151
152
- // after using withProxy you can use redis cluster instance as parameter for createRedisHandler
152
+ // after using withAdapter you can use redis cluster instance as parameter for createRedisHandler
153
153
const redisCacheHandler = createRedisHandler ({
154
154
client: redis,
155
155
keyPrefix: CACHE_PREFIX ,
Original file line number Diff line number Diff line change 18
18
" next" ,
19
19
" redis"
20
20
],
21
- "version" : " 2.1.0-canary9 " ,
21
+ "version" : " 2.1.0-canary10 " ,
22
22
"type" : " module" ,
23
23
"license" : " MIT" ,
24
24
"description" : " Next.js cache handlers" ,
35
35
"require" : " ./dist/instrumentation/instrumentation.cjs" ,
36
36
"import" : " ./dist/instrumentation/instrumentation.js"
37
37
},
38
- "./cluster/proxy " : {
39
- "require" : " ./dist/helpers/redisClusterProxy .cjs" ,
40
- "import" : " ./dist/helpers/redisClusterProxy .js"
38
+ "./cluster/adapter " : {
39
+ "require" : " ./dist/helpers/redisClusterAdapter .cjs" ,
40
+ "import" : " ./dist/helpers/redisClusterAdapter .js"
41
41
},
42
42
"./helpers/withAbortSignal" : {
43
43
"require" : " ./dist/helpers/withAbortSignal.cjs" ,
65
65
"local-lru" : [
66
66
" dist/handlers/local-lru.d.ts"
67
67
],
68
- "cluster/proxy " : [
69
- " dist/helpers/redisClusterProxy .d.ts"
68
+ "cluster/adapter " : [
69
+ " dist/helpers/redisClusterAdapter .d.ts"
70
70
],
71
71
"helpers/withAbortSignal" : [
72
72
" dist/helpers/withAbortSignal.d.ts"
Original file line number Diff line number Diff line change 7
7
parseBuffersToStrings ,
8
8
} from "../helpers/buffer" ;
9
9
import type { RedisClientType } from "@redis/client" ;
10
- import { RedisClusterCacheProxy } from "../helpers/redisClusterProxy " ;
10
+ import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter " ;
11
11
import { withAbortSignalProxy } from "../helpers/withAbortSignalProxy" ;
12
12
13
13
/**
@@ -34,7 +34,7 @@ export default function createHandler({
34
34
keyExpirationStrategy = "EXPIREAT" ,
35
35
revalidateTagQuerySize = 10_000 ,
36
36
} : CreateRedisStringsHandlerOptions <
37
- RedisClientType | RedisClusterCacheProxy
37
+ RedisClientType | RedisClusterCacheAdapter
38
38
> ) : Handler {
39
39
const client = withAbortSignalProxy ( innerClient ) ;
40
40
Original file line number Diff line number Diff line change 1
1
import type { RedisClusterType } from "@redis/client" ;
2
2
3
- export type RedisClusterCacheProxy = RedisClusterType & {
3
+ export type RedisClusterCacheAdapter = RedisClusterType & {
4
4
isReady : boolean ;
5
5
} ;
6
6
7
- export function withProxy < T extends RedisClusterType > (
7
+ export function withAdapter < T extends RedisClusterType > (
8
8
cluster : RedisClusterType ,
9
- ) : RedisClusterCacheProxy {
9
+ ) : RedisClusterCacheAdapter {
10
10
const handler : ProxyHandler < T > = {
11
11
get ( target , prop , receiver ) {
12
12
if ( prop === "isReady" ) {
@@ -17,5 +17,5 @@ export function withProxy<T extends RedisClusterType>(
17
17
} ,
18
18
} ;
19
19
20
- return new Proxy ( cluster , handler ) as RedisClusterCacheProxy ;
20
+ return new Proxy ( cluster , handler ) as RedisClusterCacheAdapter ;
21
21
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const tsup = defineConfig({
5
5
entry : [
6
6
"src/handlers/*.ts" ,
7
7
"src/instrumentation/*.ts" ,
8
- "src/helpers/redisClusterProxy .ts" ,
8
+ "src/helpers/redisClusterAdapter .ts" ,
9
9
"src/helpers/withAbortSignal.ts" ,
10
10
"src/helpers/withAbortSignalProxy.ts" ,
11
11
] ,
You can’t perform that action at this time.
0 commit comments