{-# LANGUAGE AllowAmbiguousTypes #-}
module IHP.Job.Types.Class
( Job (..)
) where
import IHP.Prelude
import IHP.FrameworkConfig.Types (FrameworkConfig)
import IHP.Job.Types.BackoffStrategy (BackoffStrategy (..))
class Job job where
perform :: (?modelContext :: ModelContext, ?context :: FrameworkConfig) => job -> IO ()
maxAttempts :: (?job :: job) => Int
maxAttempts = Int
10
timeoutInMicroseconds :: Maybe Int
timeoutInMicroseconds = Maybe Int
forall a. Maybe a
Nothing
queuePollInterval :: Int
queuePollInterval = Int
60 Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
1000000
maxConcurrency :: Int
maxConcurrency = Int
16
backoffStrategy :: BackoffStrategy
backoffStrategy = LinearBackoff { delayInSeconds :: Int
delayInSeconds = Int
30 }
staleJobTimeout :: Maybe NominalDiffTime
staleJobTimeout = NominalDiffTime -> Maybe NominalDiffTime
forall a. a -> Maybe a
Just NominalDiffTime
600