Class EventProcessor

  • All Implemented Interfaces:
    Runnable, EventListener

    public class EventProcessor
    extends Object
    implements Runnable, EventListener
    Private event processor task responsible for connecting to the SSE stream and processing incoming SSE events as well as handling any connection issues.
    • Method Detail

      • builder

        public static EventProcessor.Builder builder​(jakarta.ws.rs.client.WebTarget target,
                                                     AtomicReference<EventProcessor.State> state,
                                                     org.glassfish.jersey.client.ClientExecutor clientExecutor,
                                                     EventListener eventListener,
                                                     EventProcessor.ShutdownHandler shutdownHandler)
        Create new Event processor builder.
        Parameters:
        target - web target to be used to call remote resource.
        state - state shared with the owner of event processor instance.
        clientExecutor - executor service used for consuming events and scheduling reconnects.
        eventListener - event listener.
        shutdownHandler - shutdown callback.
        Returns:
        new EventProcessor.Builder instance.
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • awaitFirstContact

        public void awaitFirstContact()
        Await the initial contact with the SSE endpoint.