Executing an Individual Task (Electron)#


Start the Covalent services.


To execute an individual electron:

  1. Decorate it with a @lattice decorator as shown below. (Note that the @lattice decorator is applied “atop” or “around” the task’s @electron decorator.)

import covalent as ct

def product(x, y):
    return x * y
  1. Dispatch the lattice:

dispatch_id = ct.dispatch(product)(2, 3)

Executing the individual electron returns a dispatch ID that can be used to query the electron’s computation result. This is a useful technique for testing an individual electron.

See Also#

Testing an Electron