package com.sifang.modules.config;

import java.util.List;
import java.util.Map;

/**
 * @author lzp
 */
public interface SfCacheService {

    String set(String key, String value);

    String setex(String key, int seconds, String value);

    long setnx(String key, String value);

    boolean setnxDelay(String key, int delaySeconds, String value);

    Long decr(String key);

    Long incr(String key);

    String get(String key);

    void lpush(String key, String val);

    List<String> brpop(String key, int seconds);

    List<String> mget(final String... keys);

    Long exists(String... keys);

    Long del(String... keys);

    String hmset(String key, Map<String, String> hash);

    List<String> hmget(String key, String... fields);

    Boolean hexists(String key, String field);

    Long hset(final String key, final String field, final String value);

    String hget(final String key, final String field);

    Long hdel(final String key, final String... fields);

    void hdelDelay(final String key, int delaySeconds, final String... fields);

    void delDelay(int delaySeconds, final String... keys);

    void delayed(final Runnable action, final int sec);
}
