Skip to content
Snippets Groups Projects
Commit 4745b0e3 authored by Richard Alam's avatar Richard Alam
Browse files

- run pubsub listener on own thread

parent 01669ce4
No related branches found
No related tags found
No related merge requests found
package org.bigbluebutton.api.messaging;
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
......@@ -18,7 +19,6 @@ public class RedisMessagingService implements MessagingService {
private final Executor exec = Executors.newSingleThreadExecutor();
private Runnable pubsubListener;
private volatile boolean listen = false;
public RedisMessagingService(String host, int port) {
this.host = host;
......@@ -57,14 +57,21 @@ public class RedisMessagingService implements MessagingService {
@Override
public void start() {
jedis = new Jedis(host, port, 0);
if (jedis != null) {
// listen = true;
// pubsubListener = new Runnable() {
// public void run() {
try {
jedis.connect();
pubsubListener = new Runnable() {
public void run() {
jedis.psubscribe(new PubSubListener(), "bigbluebutton:conference:*");
// }
// };
// exec.execute(pubsubListener);
}
};
exec.execute(pubsubListener);
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment