private static JsonFactory createGeneratorFactory() {
        var factory = new JsonFactoryBuilder()
                .streamReadConstraints(StreamReadConstraints.builder().maxStringLength(Integer.MAX_VALUE).build())
                .build();
        factory.setCodec(new ObjectMapper(factory).disable(FLUSH_AFTER_WRITE_VALUE));
        return factory;
    }
A Server-Sent Events (SSE) renderer for asynchronous events such as
tokens from a language model.

@author lesters
container-search/src/main/java/com/yahoo/search/rendering/EventRenderer.java