io.vertx.lang.scala

Members list

Packages

Creating a package object scala that imports from the scala package is not possible. That's why this class takes care of abstracting the necessary classes/conversions away so we don't have to import from the scala package directly.

Creating a package object scala that imports from the scala package is not possible. That's why this class takes care of abstracting the necessary classes/conversions away so we don't have to import from the scala package directly.

Attributes

Scala extensions for more idiomatic handling of io.vertx.core.json.JsonObject and io.vertx.core.json.JsonArray.

Scala extensions for more idiomatic handling of io.vertx.core.json.JsonObject and io.vertx.core.json.JsonArray.

Attributes

Type members

Classlikes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
abstract class ScalaVerticle

Base class for verticle implementations.

Base class for verticle implementations.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ScalaVerticle

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class ScalaVerticleFactory extends VerticleFactory

Factory for creating Verticle-Instances from a compiled class or scala source code.

Factory for creating Verticle-Instances from a compiled class or scala source code.

Attributes

Supertypes
trait VerticleFactory
class Object
trait Matchable
class Any
class VertxExecutionContext(val vertx: Vertx, val ctx: Context) extends ExecutionContext

A scala scala.concurrent.ExecutionContext binds scala.concurrent.Promise/scala.concurrent.Future to a thread. In the case of Vert.x we have to make sure that they execute on the right context. A context could be that of a worker or a standard verticle. This execution context implementation runs all Runnables on the associated io.vertx.core.Context.

A scala scala.concurrent.ExecutionContext binds scala.concurrent.Promise/scala.concurrent.Future to a thread. In the case of Vert.x we have to make sure that they execute on the right context. A context could be that of a worker or a standard verticle. This execution context implementation runs all Runnables on the associated io.vertx.core.Context.

Taken from the original Vert.x-impl https://github.com/vert-x/mod-lang-scala/blob/master/src/main/scala/org/vertx/scala/core/VertxExecutionContext.scala

Attributes

Companion
object
Supertypes
trait ExecutionContext
class Object
trait Matchable
class Any

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def handleInFuture[T](f: Handler[AsyncResult[T]] => Unit): Future[T]

Turns a Vert.x callback function into a ScalaFuture.

Turns a Vert.x callback function into a ScalaFuture.

Value parameters

f

the callback function; if there are more parameters than just handler, you may apply it partially

Attributes

Extensions

Extensions

extension (asJava: Vertx)
def closeFuture(): Future[Unit]

Like close from io.vertx.core.Vertx but returns a Scala Future instead of taking an AsyncResultHandler.

Like close from io.vertx.core.Vertx but returns a Scala Future instead of taking an AsyncResultHandler.

Attributes

def deployVerticle(verticle: ScalaVerticle): Future[String]

Like deployVerticle but returns a Scala Future instead of taking an AsyncResultHandler.

Like deployVerticle but returns a Scala Future instead of taking an AsyncResultHandler.

Attributes

def deployVerticle(verticle: ScalaVerticle, options: DeploymentOptions): Future[String]

Like deployVerticle but returns a Scala Future instead of taking an AsyncResultHandler.

Like deployVerticle but returns a Scala Future instead of taking an AsyncResultHandler.

Attributes

def exceptionHandler(handler: Option[Throwable => Unit]): Vertx

Set a default exception handler for io.vertx.core.Context, set on io.vertx.core.Context#exceptionHandler at creation. * @param handler the exception handler

Set a default exception handler for io.vertx.core.Context, set on io.vertx.core.Context#exceptionHandler at creation. * @param handler the exception handler

Attributes

Returns

a reference to this, so the API can be used fluently

def executeBlockingScala[T](blockingFunction: () => T, ordered: Boolean): Future[T]

Safely execute some blocking code.

Safely execute some blocking code.

Executes the blocking code in the handler blockingCodeHandler using a thread from the worker pool.

When the code is complete the returned Future will be completed with the result.

Value parameters

blockingFunction

function containing blocking code

ordered

if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees

Attributes

Returns

a Future representing the result of the blocking operation

extension [T](scalaFuture: Future[T])
def asVertx: Future[T]
extension [T](scalaPromise: Promise[T])
def asVertx: Promise[T]
extension [T](vertxFuture: Future[T])
def asScala: Future[T]
extension [T](vertxPromise: Promise[T])
def asScala: Promise[T]