Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleVertxHttpServerWrapper should not create a HashMap on every request. #765

Open
RichardHightower opened this issue Sep 7, 2016 · 1 comment

Comments

@RichardHightower
Copy link
Member

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
Copy link
Member Author

@bbyk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant