260327_01_ENH: 프로젝트 구조 리펙토링 및 README.md 갱신
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.kri.common.feature.redis;
|
||||
|
||||
import java.time.Duration;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
|
||||
public class RedisQueueHelper {
|
||||
|
||||
private final StringRedisTemplate rt;
|
||||
|
||||
public RedisQueueHelper(StringRedisTemplate rt) {
|
||||
this.rt = rt;
|
||||
}
|
||||
|
||||
public void enqueue(String key, String value) {
|
||||
rt.opsForList().rightPush(key, value);
|
||||
}
|
||||
|
||||
public String blockingDequeue(String key, Duration timeout) {
|
||||
return rt.opsForList().leftPop(key, timeout);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user