接口 UserProcessorInNettyThreadAware

所有已知子接口:
UserProcessorExecutorAware
所有已知实现类:
AbstractAsyncUserProcessor, BroadcastMessageBrokerProcessor, BroadcastMessageExternalProcessor, BrokerClientItemConnectMessageBrokerProcessor, BrokerClientOfflineMessageExternalProcessor, BrokerClientOnlineMessageExternalProcessor, EndPointLogicServerMessageBrokerProcessor, EndPointLogicServerMessageExternalProcessor, EventBusMessageBrokerProcessor, EventBusMessageClientProcessor, InnerModuleMessageBrokerProcessor, InnerModuleRequestCollectExternalMessageBrokerProcessor, InnerModuleRequestCollectMessageBrokerProcessor, InnerModuleVoidMessageBrokerProcessor, PulseSignalRequestBrokerProcessor, PulseSignalRequestUserProcessor, PulseSignalResponseBrokerProcessor, PulseSignalResponseUserProcessor, RequestCollectExternalMessageExternalProcessor, RequestMessageBrokerProcessor, RequestMessageClientProcessor, ResponseMessageBrokerProcessor, ResponseMessageExternalProcessor, SettingUserIdMessageBrokerProcessor, SettingUserIdMessageExternalProcessor

public interface UserProcessorInNettyThreadAware
在 netty 线程中执行任务 aware
     默认会在执行 netty handler 的线程中执行任务,而不使用 bolt 的线程执行器;
     因为最终会将任务将由 ioGame 默认的执行器策略中,可减少上下文的切换消耗。

     相关源码可阅读 DefaultRequestMessageClientProcessorHook
 
作者:
渔民小镇
另请参阅:
日期:
2023-12-20
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    是否在执行 netty handler 的线程中执行业务
    void
    setInNettyThread(boolean inNettyThread)
    消费业务请求的线程
  • 方法详细资料

    • setInNettyThread

      void setInNettyThread(boolean inNettyThread)
      消费业务请求的线程
           默认使用执行 netty handler 的线程中执行业务
      
           相关源码
           RpcHandler
           RpcRequestProcessor.process(RemotingContext, RpcRequestCommand, ExecutorService)
      
       
      参数:
      inNettyThread - true 表示在 netty 中执行业务
    • inNettyThreadExecute

      boolean inNettyThreadExecute()
      是否在执行 netty handler 的线程中执行业务
      返回:
      true 表示在执行 netty handler 的线程中执行业务