@Override
        public void onNext(T value) {
            if (!writer.isOpen()) {
                return;
            }
            try {
                // To get an exception from the converter before sending the headers.
                final HttpData content = contentConverter.apply(value);
                if (!headersSent) {
                    writer.write(headers);
                    headersSent = true;
                }
                writer.write(content);
                writer.whenConsumed().thenRun(() -> {
                    assert subscription != null;
                    subscription.request(1);
                });
            } catch (Exception e) {
                try {
                    writer.close(e);
                } finally {
                    assert subscription != null;
                    subscription.cancel();
                }
            }
        }
A {@link Subscriber} implementation which writes a streaming response with the contents converted from
the objects published from a publisher.
core/src/main/java/com/linecorp/armeria/internal/server/ResponseConversionUtil.java