# Class: Context

## vertx-js/context~ Context

#### new Context()

  Source:
    - context.js, line 28

### 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:
    - context.js, line 68

  ##### 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:
    - context.js, line 53

  ##### 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:
    - context.js, line 146

  ##### Returns:

  the data
  Type
    Object

#### getInstanceCount() → {number}

  Source:
    - context.js, line 205

  ##### Returns:

  - the number of instances of the verticle that were deployed in the deployment (if any) related to this context
  - Type
      number

#### isEventLoopContext() → {boolean}

  Is the current context an event loop context?

  NOTE! when running blocking code using Vertx#executeBlocking from a standard (not worker) verticle, the context will still an event loop context and this will return true.

  Source:
    - context.js, line 100

  ##### Returns:

  true if false otherwise
  Type
    boolean

#### isMultiThreadedWorkerContext() → {boolean}

  Is the current context a multi-threaded worker context?
  Source:
    - context.js, line 132

  ##### Returns:

  true if the current context is a multi-threaded worker context, false otherwise
  Type
    boolean

#### isWorkerContext() → {boolean}

  Is the current context a worker context?

  NOTE! when running blocking code using Vertx#executeBlocking from a standard (not worker) verticle, the context will still an event loop context and this will return false.

  Source:
    - context.js, line 118

  ##### Returns:

  true if the current context is a worker context, false otherwise
  Type
    boolean

#### owner() → {Vertx}

  Source:
    - context.js, line 190

  ##### Returns:

  - The Vertx instance that created the context
  - Type
      Vertx

#### processArgs() → {Array.<string>}

  The process args
  Source:
    - context.js, line 82

  ##### 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:
    - context.js, line 162

#### remove(key) → {boolean}

  Remove some data from the context.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `key` | string | the key to remove

  Source:
    - context.js, line 176

  ##### 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:
    - context.js, line 39