Safe Haskell | None |
---|---|
Language | Haskell98 |
- data JobQueue e a
- type FailureHandleFn a = Alert -> String -> String -> Maybe (Job a) -> IO (Maybe (Job a))
- type AfterExecuteHandleFn a = Job a -> IO ()
- data Session
- data Unit a => Settings a = Settings {}
- openSession :: String -> IO Session
- newSession :: String -> Backend -> Session
- closeSession :: Session -> IO ()
- openJobQueue :: (Env e, Unit a) => Session -> String -> Settings a -> JobM e a () -> IO (JobQueue e a)
- closeJobQueue :: (Env e, Unit a) => JobQueue e a -> IO ()
- countJobQueue :: (Env e, Unit a) => JobQueue e a -> IO Int
- resumeJobQueue :: (Env e, Unit a) => JobQueue e a -> IO Bool
- suspendJobQueue :: forall e a. (Env e, Unit a) => JobQueue e a -> IO Bool
- executeJob :: (Env e, Unit a) => JobQueue e a -> e -> IO ()
- scheduleJob :: Unit a => JobQueue e a -> a -> IO ()
- deleteJob :: Unit a => JobQueue e a -> String -> IO Bool
- clearJobs :: Unit a => JobQueue e a -> IO [(String, Job a)]
- peekJob :: Unit a => JobQueue e a -> IO (Maybe (Job a))
Documentation
type AfterExecuteHandleFn a = Job a -> IO () Source
A session handler
A session usually represents a database session to access job queues stored in the backend database.
data Unit a => Settings a Source
Job queue settings
Settings | |
|
Open a queue session with a resource locator
Create a queue session with a backend handler
closeSession :: Session -> IO () Source
Close a queue session if needed
:: (Env e, Unit a) | |
=> Session | a session handler |
-> String | a queue name |
-> Settings a | queue settings |
-> JobM e a () | a state machine definition |
-> IO (JobQueue e a) |
Open a job queue with a session.
countJobQueue :: (Env e, Unit a) => JobQueue e a -> IO Int Source
Count the number of jobs queued in a job queue.
executeJob :: (Env e, Unit a) => JobQueue e a -> e -> IO () Source
Execute an action of the head job in a job queue.
Delete a job from a job queue.
Clear all jobs from a job queue.