本文整理匯總了Java中org.greenrobot.eventbus.ThreadMode.ASYNC屬性的典型用法代碼示例。如果您正苦於以下問題:Java ThreadMode.ASYNC屬性的具體用法?Java ThreadMode.ASYNC怎麽用?Java ThreadMode.ASYNC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.greenrobot.eventbus.ThreadMode
的用法示例。
在下文中一共展示了ThreadMode.ASYNC屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleEvent
@Subscribe(threadMode = ThreadMode.ASYNC)
public void handleEvent(RtspClientStreamEvent.MediaDataReceived event) {
Log.d(TAG, "handleEvent: RtspClientStreamEvent.MediaDataReceived");
try {
switch (rtpProtocol) {
case UDP:
sendRtp(event.data);
break;
case TCP:
Rtsp r = new RtspInterleavedData(interleavedRtpChannels.first, event.data);
rtspSession.sendRtsp(r);
break;
}
} catch (IOException e) {
// TODO: handle exception
e.printStackTrace();
}
}
示例2: onEventAsync
@Subscribe(sticky = true, threadMode = ThreadMode.ASYNC)
public void onEventAsync(final PartProgressEvent event) {
if (audioSlidePlayer != null && event.attachment.equals(this.audioSlidePlayer.getAudioSlide().asAttachment())) {
Util.runOnMain(new Runnable() {
@Override
public void run() {
downloadProgress.setInstantProgress(((float) event.progress) / event.total);
}
});
}
}
示例3: onEventAsync
@Subscribe(sticky = true, threadMode = ThreadMode.ASYNC)
public void onEventAsync(final PartProgressEvent event) {
if (this.slide != null && event.attachment.equals(this.slide.asAttachment())) {
Util.runOnMain(new Runnable() {
@Override
public void run() {
progressWheel.setInstantProgress(((float)event.progress) / event.total);
}
});
}
}
示例4: onContentAnimEvent
@Subscribe(threadMode = ThreadMode.ASYNC)
public void onContentAnimEvent(EventStartNewThread newThread) {
if (newThread.isCreate()) {
if (!TextUtils.isEmpty(newThread.getPhotoPath())) {
isMergePath = true;
mCompleterPath = newThread.getPhotoPath();
} else {
isMergePath = false;
mCompleterPath = createTempPhoto();
}
EventBus.getDefault().post(new EventStartMainThread(mCompleterPath, true));
} else {
EventBus.getDefault().post(new EventStartMainThread(mCompleterPath, false));
}
}
示例5: onEventAsync
@Subscribe(sticky = true, threadMode = ThreadMode.ASYNC)
public void onEventAsync(final PartProgressEvent event) {
if (documentSlide != null && event.attachment.equals(this.documentSlide.asAttachment())) {
Util.runOnMain(new Runnable() {
@Override
public void run() {
downloadProgress.setInstantProgress(((float) event.progress) / event.total);
}
});
}
}
示例6: handleEvent
@Subscribe(threadMode = ThreadMode.ASYNC)
public void handleEvent(RtspSessionEvent.ReceivedResponse event) {
if (event.rtspRequest != null) {
RtspStatus status = event.rtspResponse.getStatus();
if (status == RtspStatus.OK) {
handleRtspResponse(event);
} else {
handleNonOkResponse(event);
}
} else {
Log.e(TAG, "handleRtspResponse: No Request, don't know how to interpret this message");
Log.e(TAG, event.rtspResponse.toString());
}
}
示例7: handleEvent
@Subscribe(threadMode = ThreadMode.ASYNC)
public void handleEvent(RtspServerEvent.Connection event) {
Log.d(TAG, "handleEvent: RtspServerEvent.Connection");
try {
sessions.add(new RtspServerSession(this, event.socket));
} catch (IOException e) {
Log.e(TAG, "handleEvent: Failed to create RtspServerSession: " + e.getMessage());
}
}
示例8: handleEvent
/**
* RtspClientConnectionRequestEvent handler
*
* @param event RtspServerConnection event
*/
@Subscribe(threadMode = ThreadMode.ASYNC)
public void handleEvent(RtspClientStreamEvent.ConnectionRequest event) {
try {
sessions.add(new RtspClientSession(this, event));
} catch (IOException e) {
event.eventBus.post(new RtspClientStreamEvent.ConnectionError(e));
}
}
示例9: onEventAsync
@Subscribe(threadMode = ThreadMode.ASYNC)
public void onEventAsync(TestEvent event) {
eventsReceivedCount.incrementAndGet();
}
示例10: onEvent
@Subscribe(threadMode = ThreadMode.ASYNC)
public void onEvent(Object obj) {
this.applyInBackground(this.uqi, this.input);
}
示例11: subscribeOnAsncThread
/**
* 無論誰發送的消息,都會創建一個新的線程處理該消息
*/
@Subscribe(threadMode = ThreadMode.ASYNC)
public void subscribeOnAsncThread(MessageEvent messageEvent) {
Log.d(TAG, "subscribeOnAsncThread: what = " + messageEvent.what + "; msg = " + messageEvent.msg);
}
示例12: subscribeStickyMessage
/**
* 粘性消息的例子,在訂閱後,此方法會處理在訂閱前最後一次發送的消息
*/
@Subscribe(threadMode = ThreadMode.ASYNC, sticky = true)
public void subscribeStickyMessage(MessageEvent messageEvent) {
Log.d(TAG, "subscribeStickyMessage: what = " + messageEvent.what + "; msg = " + messageEvent.msg);
}
示例13: onEventExit
@Subscribe(threadMode = ThreadMode.ASYNC)
public void onEventExit(Boolean isBool){
SystemClock.sleep(1000);
isExit = false;
}
示例14: handleEvent
@Subscribe(threadMode = ThreadMode.ASYNC)
public void handleEvent(RtspClientStreamEvent.StopStreamRequest event) {
sendRtspTeardownRequest(event.stream);
}
示例15: onGsmMessageReceived
@Subscribe(threadMode = ThreadMode.ASYNC)
public void onGsmMessageReceived(GcmMessageReceivedEvent event) {
Log.d(TAG, event.getMessage());
}