当前位置: 首页>>代码示例>>Java>>正文


Java RedisCommandInterruptedException类代码示例

本文整理汇总了Java中com.lambdaworks.redis.RedisCommandInterruptedException的典型用法代码示例。如果您正苦于以下问题:Java RedisCommandInterruptedException类的具体用法?Java RedisCommandInterruptedException怎么用?Java RedisCommandInterruptedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RedisCommandInterruptedException类属于com.lambdaworks.redis包,在下文中一共展示了RedisCommandInterruptedException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNodes

import com.lambdaworks.redis.RedisCommandInterruptedException; //导入依赖的package包/类
/**
 * Load master slave nodes. Result contains an ordered list of {@link RedisNodeDescription}s. The sort key is the latency.
 * Nodes with lower latency come first.
 *
 * @param seed collection of {@link RedisURI}s
 * @return mapping between {@link RedisURI} and {@link Partitions}
 */
public List<RedisNodeDescription> getNodes(RedisURI seed) {

    List<RedisNodeDescription> nodes = topologyProvider.getNodes();

    addPasswordIfNeeded(nodes, seed);

    AsyncConnections asyncConnections = getConnections(nodes);
    Connections connections = null;

    try {

        connections = asyncConnections.get(seed.getTimeout(), seed.getUnit());
        Requests requestedPing = connections.requestPing();
        return getNodeSpecificViews(requestedPing, nodes, seed);

    } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new RedisCommandInterruptedException(e);
    } finally {
        if (connections != null) {
            connections.close();
        }
    }
}
 
开发者ID:lettuce-io,项目名称:lettuce-core,代码行数:32,代码来源:MasterSlaveTopologyRefresh.java

示例2: get

import com.lambdaworks.redis.RedisCommandInterruptedException; //导入依赖的package包/类
/**
 * Get the command output and if the command hasn't completed
 * yet, wait until it does.
 *
 * @return The command output.
 */
@Override
public T get() {
    try {
        latch.await();
        return output.get();
    } catch (InterruptedException e) {
        throw new RedisCommandInterruptedException(e);
    }
}
 
开发者ID:hakusaro,项目名称:ShankShock-Core,代码行数:16,代码来源:Command.java

示例3: await

import com.lambdaworks.redis.RedisCommandInterruptedException; //导入依赖的package包/类
/**
 * Wait up to the specified time for the command output to become
 * available.
 *
 * @param timeout   Maximum time to wait for a result.
 * @param unit      Unit of time for the timeout.
 *
 * @return true if the output became available.
 */
public boolean await(long timeout, TimeUnit unit) {
    try {
        return latch.await(timeout, unit);
    } catch (InterruptedException e) {
        throw new RedisCommandInterruptedException(e);
    }
}
 
开发者ID:hakusaro,项目名称:ShankShock-Core,代码行数:17,代码来源:Command.java


注:本文中的com.lambdaworks.redis.RedisCommandInterruptedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。