Summary
Add support for Java 21+ virtual threads (Project Loom) in the streaming STT and Voice Agent WebSocket clients, enabling efficient handling of hundreds of concurrent audio streams without thread pool exhaustion.
Problem it solves
Java developers building voice applications at scale — contact centers, meeting platforms, telephony systems — need to handle many concurrent streaming STT sessions simultaneously. The current SDK uses platform threads for WebSocket I/O, which limits practical concurrency to the thread pool size (typically 200-500 threads). With virtual threads, developers can run thousands of concurrent streaming sessions with minimal memory overhead, making Deepgram a natural fit for high-throughput Java applications.
Virtual threads are now widely adopted in Java 21+ (LTS) and supported by Spring Boot 3.2+, Quarkus 3.6+, and Micronaut 4.2+. Adding virtual thread support positions the Java SDK for modern Java deployments.
Proposed API
import com.deepgram.sdk.DeepgramClient;
import com.deepgram.sdk.listen.LiveOptions;
// Option 1: Explicit virtual thread executor
var client = DeepgramClient.builder()
.apiKey(System.getenv("DEEPGRAM_API_KEY"))
.useVirtualThreads(true) // Uses virtual thread executor for WS I/O
.build();
// Option 2: Custom executor (for frameworks that manage their own)
var client = DeepgramClient.builder()
.apiKey(System.getenv("DEEPGRAM_API_KEY"))
.executor(Executors.newVirtualThreadPerTaskExecutor())
.build();
// Concurrent streaming — each session runs on a virtual thread
var sessions = audioFiles.stream()
.map(file -> client.listen().live(options, new LiveHandler() {
@Override
public void onTranscript(LiveResult result) {
// Process transcript
}
}))
.toList();
Acceptance criteria
Raised by the DX intelligence system.
Summary
Add support for Java 21+ virtual threads (Project Loom) in the streaming STT and Voice Agent WebSocket clients, enabling efficient handling of hundreds of concurrent audio streams without thread pool exhaustion.
Problem it solves
Java developers building voice applications at scale — contact centers, meeting platforms, telephony systems — need to handle many concurrent streaming STT sessions simultaneously. The current SDK uses platform threads for WebSocket I/O, which limits practical concurrency to the thread pool size (typically 200-500 threads). With virtual threads, developers can run thousands of concurrent streaming sessions with minimal memory overhead, making Deepgram a natural fit for high-throughput Java applications.
Virtual threads are now widely adopted in Java 21+ (LTS) and supported by Spring Boot 3.2+, Quarkus 3.6+, and Micronaut 4.2+. Adding virtual thread support positions the Java SDK for modern Java deployments.
Proposed API
Acceptance criteria
useVirtualThreads()or customExecutor)Raised by the DX intelligence system.