Class ProtifyHttpClient


  • public class ProtifyHttpClient
    extends java.lang.Object
    A thread-safe, singleton HTTP client for Protify AI, featuring built-in LRU caching and thundering-herd protection without external dependencies.
    • Method Detail

      • initialize

        public static void initialize()
      • initialize

        public static void initialize​(long ttlMillis,
                                      int maxCacheSize)
        Initializes the singleton with specific configurations. Call this during application startup before the first getInstance().
      • postStream

        public java.util.concurrent.CompletableFuture<java.lang.Void> postStream​(AIProviderRequest request,
                                                                                 java.lang.String uri,
                                                                                 java.util.function.Consumer<java.lang.String> onEvent,
                                                                                 java.lang.Runnable onComplete)