qbit icon indicating copy to clipboard operation
qbit copied to clipboard

SimpleVertxHttpServerWrapper should not create a HashMap on every request.

Open RichardHightower opened this issue 8 years ago • 1 comments

SimpleVertxHttpServerWrapper should not create a HashMap on every request.

    private void handleHttpRequest(final HttpServerRequest request) {
        handleHttpRequest(request, new HashMap<>());
    }

Part of the issue is HttpRequest holds a final map.

public class HttpRequest implements Request<Object> {

    private final Map<String, Object> data;

We should probably create a final atomicReference to a Map so that the map can be set by the users. Then add an addDataObject("foo", foo) method that will lazy init the map if needed.

RichardHightower avatar Sep 07 '16 20:09 RichardHightower

@bbyk

RichardHightower avatar Sep 07 '16 20:09 RichardHightower