Package io.deephaven.stream
Interface StreamPublisher
- All Known Subinterfaces:
ConsumerRecordToStreamPublisherAdapter
- All Known Implementing Classes:
KafkaStreamPublisher
,StreamPublisherBase
public interface StreamPublisher
Chunk-oriented producer for streams of data.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
void
register
(@NotNull StreamConsumer consumer) void
shutdown()
Shutdown this StreamPublisher.
-
Method Details
-
register
Register aconsumer
whoseaccept
method will be used when sufficient data is accumulated, or onflush()
. Implementations should also be sure to deliver errors to the registered consumer via itsacceptFailure
method.consumer
must typically be primed to accept the samechunk types
that this produces, in the same order.consumer
should ensure thatthis
isshutdown
when it is no longer needed.- Parameters:
consumer
- The consumer- Throws:
IllegalStateException
- If a consumer has already been registered for this producer
-
flush
void flush()- ApiNote:
- This method has multiple uses, but its presence on the interface is to allow the registered
consumer
to "poll" for new data.
-
shutdown
void shutdown()Shutdown this StreamPublisher. Implementations should stop publishing new data and release any related resources as soon as practicable.- ApiNote:
- This method should be invoked only by the registered
consumer
when it will no longer consume new data, or by the constructing code if no consumer will ever be registered.
-