Guava EventBus Google App Engine是否友好?

2 java google-app-engine multithreading guava

GAE限制Thread在运行时创建新实例.番石榴有一个很好的EventBus,我想我想在即将到来的GAE项目中使用它.

但是如果我要遇到任何与线程相关的访问限制,我甚至不想开始这条路.所以我问:Guava是否EventBus利用线程创建?对GAE友好吗?

Sim*_*onC 5

看起来你可以创建AsyncEventBus一个GAE线程工厂:

//GAE Thread Factory
ThreadFactory factory = ThreadManager.currentRequestThreadFactory();
Executor executor = Executors.newCachedThreadPool(factory)
//AsyncEventBus
EventBus eventBus = new AsyncEventBus(executor);
Run Code Online (Sandbox Code Playgroud)

另请参阅:https://developers.google.com/appengine/docs/java/runtime