vertx-lang-scala-docs_2.12 3.8.0 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package core
  Definition Classes
    scala
-  package cli
  Definition Classes
    core
-  package datagram
  Definition Classes
    core
-  package dns
  Definition Classes
    core
-  package eventbus
  Definition Classes
    core
-  package file
  Definition Classes
    core
-  package http
  Definition Classes
    core
-  package json
  Definition Classes
    core
-  package metrics
  Definition Classes
    core
-  package net
  Definition Classes
    core
-  package parsetools
  Definition Classes
    core
-  package shareddata
  Definition Classes
    core
-  package streams
  Definition Classes
    core
- CompositeFuture
- Context
- DeploymentOptions
- Future
- MultiMap
- Promise
- TimeoutStream
- Vertx
- VertxOptions
- WorkerExecutor

c

io.vertx.scala.core

# Promise 

###
Companion object Promise

#### 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.

Linear Supertypes
AnyRef, Any
Known Subclasses
BaseBridgeEvent, BridgeEvent, BridgeEvent
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. Promise
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new Promise(_asJava: AnyRef)(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T])

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
5.  def asJava: AnyRef
6.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @native() @throws( ... )
7.  def complete(): Unit

   Calls `complete(null)`

8.  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

9.  final def eq(arg0: AnyRef): Boolean
   Definition Classes
     AnyRef
10.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
11.  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

12.  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

13.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
14.  def future(): Future[T]

    returns

      the Future associated with this promise, it can be used to be aware of the promise completion

15.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
16.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
    Annotations
      @native()
17.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
18.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
19.  final def notify(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
20.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
    Annotations
      @native()
21.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
22.  def toString(): String
    Definition Classes
      AnyRef → Any
23.  def tryComplete(): Boolean

    Calls `tryComplete(null)`.

    Calls `tryComplete(null)`. * @return `false` when the future is already completed

24.  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 returns `true` otherwise.

    Like io.vertx.scala.core.Promise#complete but returns `false` when the promise is already completed instead of throwing an IllegalStateException, it returns `true` otherwise. * @param result the result

    returns

      `false` when the future is already completed

25.  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

26.  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 returns `true` otherwise.

    Like io.vertx.scala.core.Promise#fail but returns `false` when the promise is already completed instead of throwing an IllegalStateException, it returns `true` otherwise. * @param cause the failure cause

    returns

      `false` when the future is already completed

27.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
28.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
29.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @native() @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped