Skip to content

Instantly share code, notes, and snippets.

@HeartSaVioR
Last active August 29, 2015 14:00
Show Gist options
  • Save HeartSaVioR/11158991 to your computer and use it in GitHub Desktop.
Save HeartSaVioR/11158991 to your computer and use it in GitHub Desktop.
Blpop with forcing waiting thread to interrupt
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