- Type Parameters:
T
- value type
- All Superinterfaces:
AutoCloseable
Provides access to
subscription
resources for an IuAsynchronousSubject
.-
Method Summary
Modifier and TypeMethodDescriptionlong
Gets an estimated number of values that may be advanced by the stream without blocking.void
close()
void
Reports an error that occurred that should terminate the subscription.boolean
isClosed()
Determines whether or not the subscription is closed.long
Pauses execution on the current thread until new values areaccepted
.long
Pauses execution until either a timeout interval expires or the subject is closed.stream()
Gets a stream over all values, including thoseaccepted
after the subscription was created.
-
Method Details
-
stream
Gets a stream over all values, including thoseaccepted
after the subscription was created.- Returns:
Stream
-
isClosed
boolean isClosed()Determines whether or not the subscription is closed.Once closed, all remaining values can be advanced without blocking.
- Returns:
- true if close; else false
-
available
long available()Gets an estimated number of values that may be advanced by the stream without blocking.- Returns:
- available values
-
pause
Pauses execution on the current thread until new values areaccepted
.This method has no effect on a subscription not yet backed by
IuAsynchronousPipe
.- Parameters:
acceptedCount
- count of newly accepted values to wait for; returns without delay if <= 0timeout
- amount of time to wait; should be positive- Returns:
- the actual number of values accepted while paused
- Throws:
TimeoutException
- if the timeout interval expires beforereceivedCount
values are receivedInterruptedException
- if the current thread is interrupted while waiting for values to be received- See Also:
-
pause
Pauses execution until either a timeout interval expires or the subject is closed.This method has no effect on a subscription not yet backed by
IuAsynchronousPipe
.- Parameters:
expires
- instant the timeout interval expires- Returns:
- the number of values accepted onto the pipe while paused
- Throws:
InterruptedException
- if the current thread is interrupted while waiting for the pipe to close- See Also:
-
error
Reports an error that occurred that should terminate the subscription.- Parameters:
e
-Throwable
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
-