Revision ac0c5c6d src/Ganeti/JQueue.hs
b/src/Ganeti/JQueue.hs | ||
---|---|---|
53 | 53 |
, writeJobToDisk |
54 | 54 |
, replicateManyJobs |
55 | 55 |
, isQueueOpen |
56 |
, enqueueJobs
|
|
56 |
, startJobs
|
|
57 | 57 |
) where |
58 | 58 |
|
59 | 59 |
import Control.Concurrent.MVar |
... | ... | |
430 | 430 |
isQueueOpen :: IO Bool |
431 | 431 |
isQueueOpen = liftM not (jobQueueDrainFile >>= doesFileExist) |
432 | 432 |
|
433 |
-- | Enqueue jobs. This will guarantee that jobs get executed eventually. |
|
434 |
-- Curenntly, the implementation is to unconditionally hand over the job |
|
435 |
-- to masterd. |
|
436 |
enqueueJobs :: [QueuedJob] -> IO () |
|
437 |
enqueueJobs jobs = do |
|
433 |
-- | Start enqueued jobs, currently by handing them over to masterd. |
|
434 |
startJobs :: [QueuedJob] -> IO () |
|
435 |
startJobs jobs = do |
|
438 | 436 |
socketpath <- defaultMasterSocket |
439 | 437 |
client <- getClient socketpath |
440 | 438 |
pickupResults <- mapM (flip callMethod client . PickupJob . qjId) jobs |
Also available in: Unified diff