job_launch: Control a job

Description Usage Arguments Details Value See Also Examples

Description

Launch, pause, resume, or cancel a job

Usage

1
2
3
4
5
6
7
job_launch(id, channel = "cf_internal", units = 100, verbose = FALSE, ...)

job_pause(id, verbose = FALSE, ...)

job_cancel(id, verbose = FALSE, ...)

job_resume(id, verbose = FALSE, ...)

Arguments

id

A character string containing an ID for job.

channel

Either "on_demand" (for On Demand worforce), “cf_internal” (for the Internal Channel) or "both"

units

Units to be launched.

verbose

A logical indicating whether to print details of the request.

...

Additional arguments passed to cf_query.

Details

job_launch launches a new job. job_pause pauses a currently running job. job_resume resumes a job. job_cancel cancels a job.

Value

For job_launch, a list containing details of the job. Otherwise, a logical indicating the operation was successful, otherwise an error.

See Also

job_pause, job_cancel, job_resume

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# create new job
f1 <- system.file("templates/instructions1.html", package = "crowdflower")
f2 <- system.file("templates/cml1.xml", package = "crowdflower")
j <- job_create(title = "Job Title", 
                instructions = readChar(f1, nchars = 1e8L),
                cml = readChar(f2, nchars = 1e8L))

# add data
d <- data.frame(variable = 1:3)
job_add_data(id = j, data = d)

# launch the job
job_launch(j)

# pause the job
job_pause(j)

# resume the job
job_resume(j)

# cancel the job
job_cancel(j)

# delete job
job_delete(j)

## End(Not run)

cloudyr/crowdflower documentation built on May 13, 2019, 8:20 p.m.