| java.lang.Object | |
| ↳ | net.schmizz.concurrent.Promise<V, T extends java.lang.Throwable> |
Represents promised data of the parameterized type V and allows waiting on it. An exception may also be
delivered to a waiter, and will be of the parameterized type T.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| chainer | |||||||||||
| cond | |||||||||||
| lock | |||||||||||
| log | |||||||||||
| name | |||||||||||
| pendingEx | |||||||||||
| val | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates this promise with given
name and exception chainer. | |||||||||||
Creates this promise with given
name, exception chainer, and associated lock. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Clears this promise by setting its value and queued exception to
null. | |||||||||||
Set this promise's value to
val. | |||||||||||
Queues error that will be thrown in any waiting thread or any thread that attempts to wait on this promise
hereafter.
| |||||||||||
Acquire the lock associated with this promise.
| |||||||||||
Wait indefinitely for this promise's value to be deliver.
| |||||||||||
Wait for
timeout duration for this promise's value to be deliver. | |||||||||||
Wait for
timeout duration for this promise's value to be deliver. | |||||||||||
Release the lock associated with this promise.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Creates this promise with given name and exception chainer. Allocates a new java.util.concurrent.locks.Lock lock object for this promise.
| name | Name of this promise |
|---|---|
| chainer | ExceptionChainer that will be used for chaining exceptions
|
Creates this promise with given name, exception chainer, and associated lock.
| name | Name of this promise |
|---|---|
| chainer | ExceptionChainer that will be used for chaining exceptions |
| lock | Lock to use |
Clears this promise by setting its value and queued exception to null.
Set this promise's value to val. Any waiters will be delivered this value.
| val | The value |
|---|
Queues error that will be thrown in any waiting thread or any thread that attempts to wait on this promise hereafter.
| e | The error |
|---|
Acquire the lock associated with this promise.
Wait indefinitely for this promise's value to be deliver.
| Throwable |
|---|
Wait for timeout duration for this promise's value to be deliver.
| timeout | The timeout |
|---|---|
| unit | Time unit for the timeout |
| Throwable |
|---|
Wait for timeout duration for this promise's value to be deliver.
null.| timeout | The timeout |
|---|---|
| unit | Time unit for the timeout |
null| Throwable |
|---|
Release the lock associated with this promise.