Class KeepAliveService

java.lang.Object
io.vertx.ext.mcp.transport.KeepAliveService

public class KeepAliveService extends Object
Service for managing keep-alive functionality in MCP transports. This service can be composed into transport implementations to provide periodic ping functionality without inheritance. Created By Navíd Mitchell 🤪on 8/12/25
  • Constructor Details

    • KeepAliveService

      public KeepAliveService(io.vertx.core.Vertx vertx, Duration keepAliveInterval)
  • Method Details

    • start

      public void start(Consumer<Void> pingAction)
      Start the keep-alive ping mechanism.
      Parameters:
      pingAction - Action to perform for each ping (e.g., send ping to sessions)
    • stop

      public void stop()
      Stop the keep-alive ping mechanism.
    • isActive

      public boolean isActive()
      Check if the keep-alive service is currently active.
    • getKeepAliveInterval

      public Duration getKeepAliveInterval()
      Get the configured keep-alive interval.