public void handleRequest()

in gremlin-client-demo/src/main/java/software/amazon/lambda/NeptuneGremlinClientExampleLambda.java [93:119]


    public void handleRequest(InputStream input,
                              OutputStream output,
                              Context context) throws IOException {

        try {

            String id = String.valueOf(idGenerator.nextInt());

            @SuppressWarnings("unchecked")
            Callable<Object> query = () -> g.V(id)
                    .fold()
                    .coalesce(
                            unfold(),
                            addV("Person").property(T.id, id))
                    .id().next();

            Status<Object> status = executor.execute(query);

            try (Writer writer = new BufferedWriter(new OutputStreamWriter(output, UTF_8))) {
                writer.write(status.getResult().toString());
            }

        } finally {
            input.close();
            output.close();
        }
    }