Skip to main content

Dispatch

cc.dispatch

#

Dispatches a Covalent workflow to the Covalent Cloud and returns the assigned dispatch ID. The dispatch function takes a Covalent workflow, also called a lattice, and sends it to the Covalent Cloud Server for execution.

Once dispatched, the workflow runs on a the cloud and can be monitored using the dispatch ID in the application. The dispatch function returns a wrapper function that takes the inputs of the workflow as arguments. This wrapper function can be called to execute the workflow.

Parameters

orig_lattice(lattice) – The Covalent workflow to send to the cloud.

volume - Volume instance

settings – The settings object to use. If None, the default settings will be used.

Return Type

Callable

Returns

A wrapper function which takes the inputs of the workflow as arguments.

Examples

# define a simple lattice
import covalent_cloud as cc
import covalent as ct

# create volume [optional]
volume = cc.volume("/myvolume")
@ct.lattice
def my_lattice(a: int, b: int) -> int:
return a + b

# dispatch the lattice and get the assigned dispatch ID
dispatch_id = cc.dispatch(my_lattice, volume=volume)(2, 3)