Home Reference Source Repository
import Job from 'wyst/es6/Queue/Job.js'
public class | source

Job

Extends:

eventemitter2~EventEmitterExpressiveTable → Job

API that handles the lifecycle for updating and maintaing local copies of a Job

Static Method Summary

Static Public Methods
public static

changeState(state: State, job: Job): Promise

atomically changes a Job's state in the table

public static

complete(job: *): *

public static

enqueue(job: *): *

public static

fail(job: *): *

public static

lock(job: *): *

public static

nextBatch(n: *, ids: *): *

Inherited Summary

From class Expressive
public static

create(): *

creates a new inherited instance

public

debug: *

public

is(state: string): *

expressive emit

public

when(): *

expressive once

From class Table
public static get

table: Thinky:Table: *

returns a reference to the raw Table object

public static get

returns what the table name is, useful for raw r commands

public static

createModel(config: Array): *

creates a Thinky model

public static

drop(): *

drops this table on the database, primarily used to clean up after tests

public static

empty(): *

empties all rows from the table

public static

row(attrs: Object): *

creates a new row on this Table

public

table: *

Static Public Methods

public static changeState(state: State, job: Job): Promise source

atomically changes a Job's state in the table

Params:

NameTypeAttributeDescription
state State

The state (as defined in Job.States)

job Job

The job

Return:

Promise

public static complete(job: *): * source

Params:

NameTypeAttributeDescription
job *

Return:

*

public static enqueue(job: *): * source

Params:

NameTypeAttributeDescription
job *

Return:

*

public static fail(job: *): * source

Params:

NameTypeAttributeDescription
job *

Return:

*

public static lock(job: *): * source

Params:

NameTypeAttributeDescription
job *

Return:

*

public static nextBatch(n: *, ids: *): * source

Params:

NameTypeAttributeDescription
n *
ids *

Return:

*