class Promise[T] extends AnyRef
Represents the writable side of an action that may, or may not, have occurred yet.
The io.vertx.scala.core.Promise#future method returns the io.vertx.scala.core.Future associated with a promise, the future can be used for getting notified of the promise completion and retrieve its value.
A promise extends Handler<AsyncResult<T>>
so it can be used as a callback.
- Alphabetic
- By Inheritance
- Promise
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Promise(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
complete(): Unit
Calls
complete(null)
-
def
complete(result: T): Unit
Set the result.
Set the result. Any handler will be called, if there is one, and the promise will be marked as completed.
Any handler set on the associated promise will be called. * @param result the result
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fail(message: String): Unit
Calls io.vertx.scala.core.Promise#fail with the
message
.Calls io.vertx.scala.core.Promise#fail with the
message
. * @param message the failure message -
def
fail(cause: Throwable): Unit
Set the failure.
Set the failure. Any handler will be called, if there is one, and the future will be marked as completed. * @param cause the failure cause
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
future(): Future[T]
- returns
the Future associated with this promise, it can be used to be aware of the promise completion
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
tryComplete(): Boolean
Calls
tryComplete(null)
.Calls
tryComplete(null)
. * @returnfalse
when the future is already completed -
def
tryComplete(result: T): Boolean
Like io.vertx.scala.core.Promise#complete but returns
false
when the promise is already completed instead of throwing an IllegalStateException, it returnstrue
otherwise.Like io.vertx.scala.core.Promise#complete but returns
false
when the promise is already completed instead of throwing an IllegalStateException, it returnstrue
otherwise. * @param result the result- returns
false
when the future is already completed
-
def
tryFail(message: String): Boolean
Calls io.vertx.scala.core.Promise#fail with the
message
.Calls io.vertx.scala.core.Promise#fail with the
message
. * @param message the failure message- returns
false when the future is already completed
-
def
tryFail(cause: Throwable): Boolean
Like io.vertx.scala.core.Promise#fail but returns
false
when the promise is already completed instead of throwing an IllegalStateException, it returnstrue
otherwise.Like io.vertx.scala.core.Promise#fail but returns
false
when the promise is already completed instead of throwing an IllegalStateException, it returnstrue
otherwise. * @param cause the failure cause- returns
false
when the future is already completed
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )