|
|
@ -13,7 +13,8 @@ def enum(name, *sequential, **named):
|
|
|
|
values = dict(zip(sequential, range(len(sequential))), **named)
|
|
|
|
values = dict(zip(sequential, range(len(sequential))), **named)
|
|
|
|
return type(name, (), values)
|
|
|
|
return type(name, (), values)
|
|
|
|
|
|
|
|
|
|
|
|
Status = enum('Status', QUEUED='queued', FINISHED='finished', FAILED='failed')
|
|
|
|
Status = enum('Status', QUEUED='queued', FINISHED='finished', FAILED='failed',
|
|
|
|
|
|
|
|
STARTED='started')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def unpickle(pickled_string):
|
|
|
|
def unpickle(pickled_string):
|
|
|
@ -105,6 +106,10 @@ class Job(object):
|
|
|
|
def is_failed(self):
|
|
|
|
def is_failed(self):
|
|
|
|
return self.status == Status.FAILED
|
|
|
|
return self.status == Status.FAILED
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
|
|
|
def is_started(self):
|
|
|
|
|
|
|
|
return self.status == Status.STARTED
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def func(self):
|
|
|
|
def func(self):
|
|
|
|
func_name = self.func_name
|
|
|
|
func_name = self.func_name
|
|
|
|