| java.lang.Object | |
| ↳ | net.schmizz.concurrent.Event<T extends java.lang.Throwable> |
An event can be set, cleared, or awaited, similar to Python's threading.event. The key difference is that a
waiter may be delivered an exception of parameterized type T.
Promise under the hood.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| SOME | |||||||||||
| promise | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates this event with given
name and exception chainer. | |||||||||||
Creates this event with given
name, exception chainer, and associated lock. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Await this event to have a definite
true or false value. | |||||||||||
Await this event to have a definite
true or false value, for timeout duration. | |||||||||||
Clear this event.
| |||||||||||
Deliver the error
t (after chaining) to any present or future waiters. | |||||||||||
Acquire the lock associated with this event.
| |||||||||||
Sets this event to be
true. | |||||||||||
Await this event to have a definite
true or false value, for timeout duration. | |||||||||||
Release the lock associated with this event.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Creates this event with given name and exception chainer. Allocates a new java.util.concurrent.locks.Lock Lock object for this event.
| name | Name of this event |
|---|---|
| chainer | ExceptionChainer that will be used for chaining exceptions
|
Creates this event with given name, exception chainer, and associated lock.
| name | Name of this event |
|---|---|
| chainer | ExceptionChainer that will be used for chaining exceptions |
| lock | Lock to use |
Await this event to have a definite true or false value.
| Throwable |
|---|
Await this event to have a definite true or false value, for timeout duration.
| timeout | Timeout |
|---|---|
| unit | The time unit for the timeout |
| Throwable |
|---|
Clear this event. A cleared event !isSet().
Deliver the error t (after chaining) to any present or future waiters.
| t |
|---|
set() or deliverError(Throwable)
Acquire the lock associated with this event.
Sets this event to be true. Short for set(true).
Await this event to have a definite true or false value, for timeout duration.
false.| timeout | Timeout |
|---|---|
| unit | The time unit for the timeout |
| Throwable |
|---|
Release the lock associated with this event.