Last active
August 29, 2015 14:00
-
-
Save HeartSaVioR/11158991 to your computer and use it in GitHub Desktop.
Blpop with forcing waiting thread to interrupt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ListCommandsTest extends JedisCommandTestBase { | |
public void blpopWithForceKill() throws InterruptedException { | |
Thread th = new Thread(new Runnable() { | |
@Override | |
public void run() { | |
jedis.blpop(100, "foo"); | |
} | |
}); | |
th.start(); | |
Thread.sleep(1000); | |
jedis.disconnect(); | |
jedis.connect(); | |
th.join(); // it doesn't wait 100 secs | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment