Class: UdfJob

UdfJob

Job class for waiting for UDF module registration/deregistration to complete across an entire Aerospike cluster.


new UdfJob()

Source:
See:
Example
const Aerospike = require('aerospike')

let path = './udf/my_module.lua'

Aerospike.connect()
  .then(client => {
    client.udfRegister(path)
    .then(job => job.wait())
    .then(() => {
      console.info('UDF module %s was registered successfully', path)
      client.close()
    })
    .catch(error => {
      console.error('Error registering UDF module:', error)
      client.close()
    })
  })
  .catch(error => console.error('Error connecting to cluster:',  error))

Extends

Methods


wait( [pollInterval] [, callback])

Wait until the Lua module has been registered/unregistered with the entire cluster.

Parameters:
Name Type Argument Default Description
pollInterval number <optional>
1000

Interval in milliseconds to use when polling the cluster nodes.

callback doneCallback <optional>

The function to call when the operation completes.

Overrides:
Source:
Returns:

If no callback function is passed, the function returns a Promise that resolves once the job is completed.

Type
Promise