private static void invokeSynchronously( ServiceRequestContext ctx, Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) { final ProcessFunction<Object, TBase<?, ?>> f = func.syncFunc(); ctx.blockingTaskExecutor().execute(() -> { if (reply.isDone()) { // Closed already most likely due to timeout. return; } try { if (func.isOneWay()) { reply.complete(null); f.getResult(impl, args); } else { final TBase<?, ?> result = f.getResult(impl, args); reply.complete(func.getResult(result)); } } catch (Throwable t) { if (func.isOneWay()) { reply.complete(null); logOneWayFunctionFailure(ctx, t); } else { reply.completeExceptionally(t); } } }); }
result = getResult(iface, args); } catch (TTransportException ex) { LOGGER.error("Transport error while processing " + getMethodName(), ex);
private static void invokeSynchronously( ServiceRequestContext ctx, Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) { final ProcessFunction<Object, TBase<?, ?>> f = func.syncFunc(); ctx.blockingTaskExecutor().execute(() -> { if (reply.isDone()) { // Closed already most likely due to timeout. return; } try { if (func.isOneWay()) { reply.complete(null); f.getResult(impl, args); } else { final TBase<?, ?> result = f.getResult(impl, args); reply.complete(func.getResult(result)); } } catch (Throwable t) { if (func.isOneWay()) { reply.complete(null); logOneWayFunctionFailure(ctx, t); } else { reply.completeExceptionally(t); } } }); }
private static void invokeSynchronously( ServiceRequestContext ctx, Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) { final ProcessFunction<Object, TBase<?, ?>> f = func.syncFunc(); ctx.blockingTaskExecutor().execute(() -> { if (reply.isDone()) { // Closed already most likely due to timeout. return; } try { if (func.isOneWay()) { reply.complete(null); f.getResult(impl, args); } else { final TBase<?, ?> result = f.getResult(impl, args); reply.complete(func.getResult(result)); } } catch (Throwable t) { if (func.isOneWay()) { reply.complete(null); logOneWayFunctionFailure(ctx, t); } else { reply.completeExceptionally(t); } } }); }
private static void invokeSynchronously( ServiceRequestContext ctx, Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) { final ProcessFunction<Object, TBase<?, ?>> f = func.syncFunc(); ctx.blockingTaskExecutor().execute(() -> { if (reply.isDone()) { // Closed already most likely due to timeout. return; } try { final TBase<?, ?> result = f.getResult(impl, args); if (func.isOneWay()) { reply.complete(null); } else { reply.complete(func.getResult(result)); } } catch (Throwable t) { reply.completeExceptionally(t); } }); } }