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 TypeMethodDescriptionvoidflush()voidregister(@NotNull StreamConsumer consumer) voidshutdown()Shutdown this StreamPublisher.
-
Method Details
-
register
Register aconsumerwhoseacceptmethod will be used when sufficient data is accumulated, or onflush(). Implementations should also be sure to deliver errors to the registered consumer via itsacceptFailuremethod.consumermust typically be primed to accept the samechunk typesthat this produces, in the same order.consumershould ensure thatthisisshutdownwhen 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
consumerto "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
consumerwhen it will no longer consume new data, or by the constructing code if no consumer will ever be registered.
-