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 @@ -126,10 +126,10 @@ const redisHandler = await createRedisHandler({
126
126
``` js
127
127
import { createCluster } from " @redis/client" ;
128
128
import createRedisHandler from " @fortedigital/nextjs-cache-handler/redis-strings" ;
129
- import { withProxy } from " @fortedigital/nextjs-cache-handler/cluster/proxy " ;
129
+ import { withAdapter } from " @fortedigital/nextjs-cache-handler/cluster/adapter " ;
130
130
131
131
const { hostname: redisHostName } = new URL (process .env .REDIS_URL );
132
- redis = withProxy (
132
+ redis = withAdapter (
133
133
createCluster ({
134
134
rootNodes: [{ url: process .env .REDIS_URL }],
135
135
@@ -145,7 +145,7 @@ redis = withProxy(
145
145
})
146
146
);
147
147
148
- // after using withProxy you can use redis cluster instance as parameter for createRedisHandler
148
+ // after using withAdapter you can use redis cluster instance as parameter for createRedisHandler
149
149
const redisCacheHandler = createRedisHandler ({
150
150
client: redis,
151
151
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