Top Description Methods
org.osgi.util.pushstream

public Interface PushEventSource<T>

Known Direct Subinterfaces
org.osgi.util.pushstream.SimplePushEventSource
Known Direct Implementers
org.osgi.util.pushstream.PushStreamProvider.PushEventPipe
Annotations
@ConsumerType
@FunctionalInterface
Type Parameters
<T>
The payload type
Imports
org.osgi.annotation.versioning.ConsumerType

An event source. An event source can open a channel between a source and a consumer. Once the channel is opened (even before it returns) the source can send events to the consumer. A source should stop sending and automatically close the channel when sending an event returns a negative value, see PushEventConsumer#ABORT. Values that are larger than 0 should be treated as a request to delay the next events with those number of milliseconds.

Method Summary

Modifier and TypeMethod and Description
public AutoCloseable

Returns:

a AutoCloseable that can be used to close the stream
open
(PushEventConsumer<? super T>
the consumer (not null)
aec
)

Open the asynchronous channel between the source and the consumer.

Method Detail

openback to summary
public AutoCloseable open(PushEventConsumer<? super T> aec) throws Exception

Open the asynchronous channel between the source and the consumer. The call returns an AutoCloseable. This can be closed, and should close the channel, including sending a Close event if the channel was not already closed. The returned object must be able to be closed multiple times without sending more than one Close events.

Parameters
aec:PushEventConsumer<? super T>

the consumer (not null)

Returns:AutoCloseable

a AutoCloseable that can be used to close the stream