Skip to content

Instantly share code, notes, and snippets.

@Oziomajnr
Created August 12, 2018 22:40
Show Gist options
  • Save Oziomajnr/f1beea451f78083a25569356876a2bdb to your computer and use it in GitHub Desktop.
Save Oziomajnr/f1beea451f78083a25569356876a2bdb to your computer and use it in GitHub Desktop.
import com.google.common.eventbus.AsyncEventBus;
import com.google.common.eventbus.EventBus;
import java.util.concurrent.Executors;
public class EventBusFactory {
//hold the instance of the event bus here
private static EventBus eventBus = new AsyncEventBus(Executors.newCachedThreadPool());
public static EventBus getEventBus() {
return eventBus;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment