Interface AutoModeSwitchHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AutoModeSwitchHandler
Handler for auto-mode-switch requests from the agent.

Register an auto-mode-switch handler via SessionConfig.setOnAutoModeSwitch(AutoModeSwitchHandler) or ResumeSessionConfig.setOnAutoModeSwitch(AutoModeSwitchHandler). When provided, the server routes autoModeSwitch.request callbacks to this handler.

Example Usage


 AutoModeSwitchHandler handler = (request, invocation) -> {
 	System.out.println("Rate limited: " + request.getErrorCode());
 	return CompletableFuture.completedFuture(AutoModeSwitchResponse.YES);
 };

 var session = client.createSession(new SessionConfig().setOnAutoModeSwitch(handler)).get();
 
Since:
1.0.8
See Also: