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

openvidu-java-client : change to lambda function #821

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lastname-dev
Copy link

HttpClientResponseHandler<Connection> responseHandler = response -> {
    int status = response.getCode();
    if (status == 200) {
        Connection connection = new Connection(OpenVidu.httpResponseEntityToJson(response.getEntity()));
        Session.this.connections.put(connection.getConnectionId(), connection);
        return connection;
    } else {
        throw OpenVidu.openViduHttpException(status);
    }
};

In this code, the HttpClientResponseHandler is converted to a lambda function, taking response as a parameter and implementing the handleResponse method. This change simplifies the code while maintaining the same functionality.

@CSantosM CSantosM force-pushed the master branch 10 times, most recently from bfa4d17 to 33d1192 Compare July 30, 2024 16:13
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

Successfully merging this pull request may close these issues.

1 participant