UdfJob

UdfJob

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

Constructor

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(pollIntervalopt, callbackopt) → (nullable) {Promise}

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

Source:
Overrides:
Parameters:
Name Type Attributes 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.

Returns:

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

Type
Promise