@Override public void messageRead(ByteBufOrStream message) { try { final O msg = marshaller.deserializeResponse(message); if (firstResponse == null) { firstResponse = msg; } if (unsafeWrapResponseBuffers && message.buf() != null) { GrpcUnsafeBufferUtil.storeBuffer(message.buf(), msg, ctx); } try (SafeCloseable ignored = ctx.push()) { listener.onMessage(msg); } } catch (Throwable t) { req.close(Status.fromThrowable(t).asException()); throw t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t); } }
new ByteArrayInputStream(responseString.getBytes(StandardCharsets.UTF_8)) ); responseListener.onMessage(responseObject); responseListener.onClose(Status.OK, new Metadata());
@Override public void messageRead(ByteBufOrStream message) { try { final O msg = marshaller.deserializeResponse(message); if (firstResponse == null) { firstResponse = msg; } if (unsafeWrapResponseBuffers && message.buf() != null) { GrpcUnsafeBufferUtil.storeBuffer(message.buf(), msg, ctx); } try (SafeCloseable ignored = ctx.push()) { listener.onMessage(msg); } } catch (Throwable t) { req.close(Status.fromThrowable(t).asException()); throw t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t); } }
@Override public void onMessage(RespT message) { delegate().onMessage(message); }
@Override public void onMessage(RespT message) { SpanInScope scope = tracer.withSpanInScope(span); try { // retrolambda can't resolve this try/finally parser.onMessageReceived(message, span.customizer()); delegate().onMessage(message); } finally { scope.close(); } }
private void useResponse(AttemptListener attempt) { responseListener.onHeaders(attempt.responseHeaders); if (attempt.responseMessage != null) { responseListener.onMessage(attempt.responseMessage); } responseListener.onClose(attempt.responseStatus, attempt.responseTrailers); }
@Override public void sendMessage(RequestT message) { responseListener.onHeaders(headers); responseListener.onMessage(response); responseListener.onClose(status, headers); } }
@Override public void onMessage(RespT message) { delegate().onMessage(message); }
@Override public void onMessage(RespT message) { SpanInScope scope = tracer.withSpanInScope(span); try { // retrolambda can't resolve this try/finally parser.onMessageReceived(message, span.customizer()); delegate().onMessage(message); } finally { scope.close(); } }