yesod-job-queue-0.1.0.2: Background jobs library for Yesod.

Safe HaskellNone
LanguageHaskell2010

Yesod.JobQueue

Synopsis

Documentation

class (Yesod master, Read (JobType master), Show (JobType master), Enum (JobType master), Bounded (JobType master), JobInfo (JobType master)) => YesodJobQueue master where Source

Minimal complete definition

runJob, runDBJob, getJobState

Associated Types

type JobType master Source

Methods

runJob :: (MonadBaseControl IO m, MonadIO m) => master -> JobType master -> ReaderT master m () Source

queueKey :: master -> ByteString Source

readJobType :: master -> String -> Maybe (JobType master) Source

showJobType :: JobType master -> String Source

allJobTypes :: master -> [JobType master] Source

runDBJob :: (MonadBaseControl IO m, MonadIO m) => ReaderT (YesodPersistBackend master) (ReaderT master m) a -> ReaderT master m a Source

startDequeue :: (MonadBaseControl IO m, MonadIO m) => master -> m () Source

getJobState :: master -> JobState Source

get job state

jobAPIBaseUrl :: master -> String Source

get API and Manager base url

jobManagerJSUrl :: master -> String Source

get manager application javascript url (change only development)

enqueue :: master -> JobType master -> IO () Source

listQueue :: master -> IO (Either String [JobQueueItem]) Source

getClassInformation :: master -> [JobQueueClassInfo] Source

get information of all type classes related job-queue

type JobState = TVar [RunningJob] Source

Manage the running jobs

class JobInfo j where Source

Minimal complete definition

Nothing

Methods

describe :: j -> String Source

newJobState :: IO (TVar [RunningJob]) Source

create new JobState