public interface AcpAgentTransport extends AcpTransport
AcpTransport. It allows setting handlers
for messages that are incoming from the ACP client and hooking in to exceptions raised
on the transport layer.
The agent transport is used by agent implementations that want to receive requests from code editors/clients through the Agent Client Protocol.
| 限定符和类型 | 方法和说明 |
|---|---|
reactor.core.publisher.Mono<java.lang.Void> |
awaitTermination()
Returns a Mono that completes when the transport terminates.
|
default void |
setExceptionHandler(java.util.function.Consumer<java.lang.Throwable> handler)
Sets the exception handler for exceptions raised on the transport layer.
|
reactor.core.publisher.Mono<java.lang.Void> |
start(java.util.function.Function<reactor.core.publisher.Mono<AcpSchema.JSONRPCMessage>,reactor.core.publisher.Mono<AcpSchema.JSONRPCMessage>> handler)
Used to register the incoming messages' handler and start listening for client
connections.
|
close, closeGracefully, protocolVersions, sendMessage, unmarshalFromreactor.core.publisher.Mono<java.lang.Void> start(java.util.function.Function<reactor.core.publisher.Mono<AcpSchema.JSONRPCMessage>,reactor.core.publisher.Mono<AcpSchema.JSONRPCMessage>> handler)
handler - a transformer for incoming messagesMono that terminates upon successful agent setup. The successful
termination of the returned Mono simply means the agent can now receive
requests. An error can be retried according to the application requirements.default void setExceptionHandler(java.util.function.Consumer<java.lang.Throwable> handler)
handler - Allows reacting to transport level exceptions by the higher layersreactor.core.publisher.Mono<java.lang.Void> awaitTermination()
Example usage:
transport.start(handler).block();
transport.awaitTermination().block(); // Block until stdin closes
Mono that completes when the transport terminates