Interface SinkProvider<T>

Type Parameters:
T - event type
All Known Implementing Classes:
SseSinkProvider

public interface SinkProvider<T>
ServiceLoader provider interface for Sink providers.
  • Method Details

    • supports

      boolean supports(GenericType<? extends Sink<?>> type, ServerRequest request)
      Checks if a provider supports the type.
      Parameters:
      type - the type
      request - the current request
      Returns:
      outcome of test
    • create

      default <X extends Sink<T>> X create(SinkProviderContext context)
      Creates a sink using this provider.
      Type Parameters:
      X - type of sink
      Parameters:
      context - a context for a sync provider
      Returns:
      newly created sink
    • create

      @Deprecated(since="4.1.2", forRemoval=true) <X extends Sink<T>> X create(ServerResponse response, BiConsumer<Object,MediaType> eventConsumer, Runnable closeRunnable)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a sink using this provider.
      Type Parameters:
      X - type of sink
      Parameters:
      response - the HTTP response
      eventConsumer - an event consumer
      closeRunnable - a runnable to call on close
      Returns:
      newly created sink