implicit final class VertxContextOps extends AnyVal
- Alphabetic
- By Inheritance
- VertxContextOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new VertxContextOps(target: Context)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##(): Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def executeBlockingL[T](blockingCodeHandler: Handler[Promise[T]]): Task[T]
Invoke
boolean, Handler)
with order = true.Invoke
boolean, Handler)
with order = true.- blockingCodeHandler
handler representing the blocking code to run
- def executeBlockingL[T](blockingCodeHandler: Handler[Promise[T]], ordered: Boolean): Task[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 handler
resultHandler
will be called with the result on the original context (e.g. on the original event loop of the caller).A
Future
instance is passed intoblockingCodeHandler
. When the blocking code successfully completes, the handler should call thePromise#complete
orPromise#complete(Object)
method, or thePromise#fail
method if it failed.The blocking code should block for a reasonable amount of time (i.e no more than a few seconds). Long blocking operations or polling operations (i.e a thread that spin in a loop polling events in a blocking fashion) are precluded.
When the blocking operation lasts more than the 10 seconds, a message will be printed on the console by the blocked thread checker.
Long blocking operations should use a dedicated thread managed by the application, which can interact with verticles using the event-bus or
Context#runOnContext(Handler)
- blockingCodeHandler
handler representing the blocking code to run
- 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
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val target: Context
- def toString(): String
- Definition Classes
- Any