Class: Context

vertx-js/context~ Context

new Context()

Source:

Methods

config() → {Object}

If the context is associated with a Verticle deployment, this returns the configuration that was specified when the verticle was deployed.
Source:
Returns:
the configuration of the deployment or null if not a Verticle deployment
Type
Object

deploymentID() → {string}

If the context is associated with a Verticle deployment, this returns the deployment ID of that deployment.
Source:
Returns:
the deployment ID of the deployment or null if not a Verticle deployment
Type
string

get(key) → {Object}

Get some data from the context.
Parameters:
Name Type Description
key string the key of the data
Source:
Returns:
the data
Type
Object

isEventLoopContext() → {boolean}

Source:
Returns:
  • true if this is an event loop context, false otherwise
  • Type
    boolean

isMultiThreaded() → {boolean}

Source:
Returns:
  • true if this is a multi-threaded worker context, false otherwise
  • Type
    boolean

isWorker() → {boolean}

Source:
Returns:
  • true if this is an worker context, false otherwise
  • Type
    boolean

owner() → {Vertx}

Source:
Returns:
  • The Vertx instance that created the context
  • Type
    Vertx

processArgs() → {Array.<string>}

The process args
Source:
Returns:
Type
Array.<string>

put(key, value)

Put some data in the context.

This can be used to share data between different handlers that share a context

Parameters:
Name Type Description
key string the key of the data
value Object the data
Source:

remove(key) → {boolean}

Remove some data from the context.
Parameters:
Name Type Description
key string the key to remove
Source:
Returns:
true if removed successfully, false otherwise
Type
boolean

runOnContext(action)

Run the specified action asynchronously on the same context, some time after the current execution has completed.
Parameters:
Name Type Description
action function the action to run
Source: