You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/10/01 15:34:58 UTC

[GitHub] hjianhao opened a new issue #940: Suggestion : provide executeBlocking mechanism

hjianhao opened a new issue #940: Suggestion : provide executeBlocking mechanism
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/940
 
 
   In our project, we using reactive mode to gain high performance in high concurrency scenarios.  But sometimes we had using a few legacy Blocking API. 
   
   So we need to using executor's executeBlocking to running these blocking code. but with this raw vert.x API, blocking code lost the InvocationContext. we need to using ugly wrapper to passing InvocationContext, traceId, etc , just like following : 
   
   public class TraceUtils <T> {
   	public static <T> Handler<T> traceable (Handler<T> fromHandler) {
   		String traceId = MDC.get(MDC.TRACE_ID_KEY);
   		return T -> {
   			MDC.put (MDC.TRACE_ID_KEY, traceId);
   			fromHandler.handle(T);
   		};
   	}
   }  
   
   If servicecomb provide similar executingBlocking API, and passing the InvocationContext. it would be helpful. we can using InvocationContext the pass the context variable like traceId.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services