Class EventConsumerExecutorProducer

java.lang.Object
org.a2aproject.sdk.server.util.async.EventConsumerExecutorProducer

@ApplicationScoped public class EventConsumerExecutorProducer extends Object
Produces a dedicated executor for EventConsumer polling threads.

CRITICAL: EventConsumer polling must use a separate executor from AgentExecutor because:

  • EventConsumer threads are I/O-bound (blocking on queue.poll()), not CPU-bound
  • One EventConsumer thread needed per active queue (can be 100+ concurrent)
  • Threads are mostly idle, waiting for events
  • Using the same bounded pool as AgentExecutor causes deadlock when pool exhausted

Uses a cached thread pool (unbounded) with automatic thread reclamation:

  • Creates threads on demand as EventConsumers start
  • Idle threads automatically terminated after 10 seconds
  • No queue saturation since threads are created as needed
  • Constructor Details

    • EventConsumerExecutorProducer

      public EventConsumerExecutorProducer()
  • Method Details

    • eventConsumerExecutor

      @Produces @ApplicationScoped public Executor eventConsumerExecutor()