當前位置: 首頁>>代碼示例>>Java>>正文


Java ThreadMode.ASYNC屬性代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:devinbrown7,項目名稱:streaminglib,代碼行數:19,代碼來源:RtpServerStream.java

示例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);
      }
    });
  }
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:11,代碼來源:AudioView.java

示例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);
      }
    });
  }
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:11,代碼來源:TransferControlView.java

示例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));
    }
}
 
開發者ID:junchenChow,項目名稱:exciting-app,代碼行數:15,代碼來源:VoiceMainActivity.java

示例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);
      }
    });
  }
}
 
開發者ID:CableIM,項目名稱:Cable-Android,代碼行數:11,代碼來源:DocumentView.java

示例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());
    }
}
 
開發者ID:devinbrown7,項目名稱:streaminglib,代碼行數:14,代碼來源:RtspSession.java

示例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());
    }
}
 
開發者ID:devinbrown7,項目名稱:streaminglib,代碼行數:9,代碼來源:RtspServer.java

示例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));
    }
}
 
開發者ID:devinbrown7,項目名稱:streaminglib,代碼行數:13,代碼來源:RtspClient.java

示例9: onEventAsync

@Subscribe(threadMode = ThreadMode.ASYNC)
public void onEventAsync(TestEvent event) {
    eventsReceivedCount.incrementAndGet();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:PerfTestEventBus.java

示例10: onEvent

@Subscribe(threadMode = ThreadMode.ASYNC)
public void onEvent(Object obj) {
    this.applyInBackground(this.uqi, this.input);
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:4,代碼來源:AsyncFunction.java

示例11: subscribeOnAsncThread

/**
 * 無論誰發送的消息,都會創建一個新的線程處理該消息
 */
@Subscribe(threadMode = ThreadMode.ASYNC)
public void subscribeOnAsncThread(MessageEvent messageEvent) {
    Log.d(TAG, "subscribeOnAsncThread: what = " + messageEvent.what + "; msg = " + messageEvent.msg);
}
 
開發者ID:OkayCamera,項目名稱:OkayCamera-Android,代碼行數:7,代碼來源:MainActivity.java

示例12: subscribeStickyMessage

/**
 * 粘性消息的例子,在訂閱後,此方法會處理在訂閱前最後一次發送的消息
 */
@Subscribe(threadMode = ThreadMode.ASYNC, sticky = true)
public void subscribeStickyMessage(MessageEvent messageEvent) {
    Log.d(TAG, "subscribeStickyMessage: what = " + messageEvent.what + "; msg = " + messageEvent.msg);
}
 
開發者ID:OkayCamera,項目名稱:OkayCamera-Android,代碼行數:7,代碼來源:MainActivity.java

示例13: onEventExit

@Subscribe(threadMode = ThreadMode.ASYNC)
public void onEventExit(Boolean isBool){
    SystemClock.sleep(1000);
    isExit = false;
}
 
開發者ID:jenly1314,項目名稱:KingTV,代碼行數:5,代碼來源:MainActivity.java

示例14: handleEvent

@Subscribe(threadMode = ThreadMode.ASYNC)
public void handleEvent(RtspClientStreamEvent.StopStreamRequest event) {
    sendRtspTeardownRequest(event.stream);
}
 
開發者ID:devinbrown7,項目名稱:streaminglib,代碼行數:4,代碼來源:RtspClientSession.java

示例15: onGsmMessageReceived

@Subscribe(threadMode = ThreadMode.ASYNC)
public void onGsmMessageReceived(GcmMessageReceivedEvent event) {
    Log.d(TAG, event.getMessage());
}
 
開發者ID:ukevgen,項目名稱:BizareChat,代碼行數:4,代碼來源:MainActivity.java


注:本文中的org.greenrobot.eventbus.ThreadMode.ASYNC屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。