public interface AcpClientTransport extends AcpTransport
AcpTransport. It allows setting handlers
for messages that are incoming from the ACP agent and hooking in to exceptions raised
on the transport layer.
The client transport is used by applications that want to communicate with an external coding agent through the Agent Client Protocol.
| 限定符和类型 | 方法和说明 |
|---|---|
reactor.core.publisher.Mono<java.lang.Void> |
connect(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 potentially (eagerly) connect
to the agent.
|
default void |
setExceptionHandler(java.util.function.Consumer<java.lang.Throwable> handler)
Sets the exception handler for exceptions raised on the transport layer.
|
close, closeGracefully, protocolVersions, sendMessage, unmarshalFromreactor.core.publisher.Mono<java.lang.Void> connect(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 client setup. It can mean
establishing a connection (which can be later disposed) but it doesn't have to,
depending on the transport type. The successful termination of the returned
Mono simply means the client can now be used. 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 layers