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

Safe HaskellNone




Background jobs library for Yesod. Use example is in



class (Yesod master, Read (JobType master), Show (JobType master), Generic (JobType master), Constructors (Rep (JobType master))) => YesodJobQueue master where Source #

Backend jobs for Yesod

Minimal complete definition

runJob, runDBJob, getJobState

Associated Types

type JobType master Source #

Custom Job Type


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

Job Handler

queueConnectInfo :: master -> ConnectInfo Source #

connection info for redis

queueKey :: master -> ByteString Source #

queue key name for redis

threadNumber :: master -> Int Source #

The number of threads to run the job

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

runDB for job

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)

describeJob :: master -> JobTypeString -> Maybe Text Source #

Job Information

getClassInformation :: master -> [JobQueueClassInfo] Source #

get information of all type classes related job-queue

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

enqueue :: (MonadIO m, YesodJobQueue master) => master -> JobType master -> m () Source #

Add job to end of the queue

type JobState = TVar [RunningJob] Source #

Manage the running jobs

newJobState :: IO (TVar [RunningJob]) Source #

create new JobState

Orphan instances

YesodJobQueue master => YesodSubDispatch JobQueue (HandlerT master IO) Source #

JobQueue manager subsite