arbiter-servant-0.1.0.0: Servant REST API for arbiter job queue
Safe HaskellNone
LanguageGHC2024

Arbiter.Servant

Description

Servant REST API for Arbiter job queue administration.

Includes endpoints for:

  • Job management (list, get, cancel, promote)
  • Dead letter queue operations (list, retry, delete)
  • Queue statistics and monitoring

Quick Start

import Arbiter.Servant
import Data.Proxy (Proxy(..))

main :: IO ()
main = do
  -- Create server config (creates its own pool and registers event triggers)
  config <- initArbiterServer (Proxy @MyRegistry) connStr "public"

  -- Start API server on port 8080
  runArbiterAPI 8080 config
Synopsis

Server

arbiterServer :: forall (registry :: [(Symbol, Type)]). BuildServer registry registry => ArbiterServerConfig registry -> ServerT (ArbiterAPI registry) Handler Source #

Complete Arbiter server at /api/v1/...

arbiterApp :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig registry -> Application Source #

Convert to WAI Application

runArbiterAPI :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => Port -> ArbiterServerConfig registry -> IO () Source #

Run the API server on a specific port.

Uses setTimeout 0 (no idle timeout) so that SSE streaming connections are not killed by Warp.

data ArbiterServerConfig (registry :: k) Source #

Configuration for the API server

Constructors

ArbiterServerConfig 

Fields

  • serverEnv :: SimpleEnv registry

    The SimpleEnv containing schema and connection pool

  • enableSSE :: Bool

    Enable Server-Sent Events streaming endpoint. When False, the /events/stream endpoint returns a single "disabled" event and closes immediately, avoiding long-lived connections. The admin UI falls back to polling-only mode. Default: True.

initArbiterServer :: forall (registry :: JobPayloadRegistry). AllQueuesUnique registry => Proxy registry -> ByteString -> Text -> IO (ArbiterServerConfig registry) Source #

Create an ArbiterServerConfig with its own internal connection pool.

Note: Use runMigrationsForRegistry with enableEventStreaming = True to set up the database triggers for SSE.

class BuildServer (registry :: k) (reg :: [(Symbol, Type)]) where Source #

Type class to build server implementations for registry entries

Methods

buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI reg) Handler Source #

Instances

Instances details
RegistryTables registry => BuildServer (registry :: JobPayloadRegistry) ('[] :: [(Symbol, Type)]) Source # 
Instance details

Defined in Arbiter.Servant.Server

Methods

buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI ('[] :: [(Symbol, Type)])) Handler Source #

(JobPayload payload, KnownSymbol tableName, RegistryTables registry) => BuildServer (registry :: JobPayloadRegistry) '['(tableName, payload)] Source # 
Instance details

Defined in Arbiter.Servant.Server

Methods

buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI '['(tableName, payload)]) Handler Source #

(BuildServer registry (nextTable ': moreRest), JobPayload payload, KnownSymbol tableName) => BuildServer (registry :: k) ('(tableName, payload) ': (nextTable ': moreRest)) Source # 
Instance details

Defined in Arbiter.Servant.Server

Methods

buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI ('(tableName, payload) ': (nextTable ': moreRest))) Handler Source #

API Types

type ArbiterAPI (registry :: [(Symbol, Type)]) = "api" :> ("v1" :> RegistryToAPI registry) Source #

Top-level Arbiter API

Routes are generated from the registry:

  • /api/v1/:tableName/jobs/... for each table in registry
  • /api/v1/queues - list all available queues
  • /api/v1/events/stream - real-time job updates (SSE)

type family RegistryToAPI (registry :: [(Symbol, Type)]) where ... Source #

Type family to build API routes from registry For registry '[ '("table1", Payload1), '("table2", Payload2) ] Generates: Capture "table1" :> NamedRoutes (TableAPI Payload1) :| Capture "table2" :> NamedRoutes (TableAPI Payload2) :| queues :| events

Equations

RegistryToAPI ('[] :: [(Symbol, Type)]) = ("queues" :> NamedRoutes (QueuesAPI :: Type -> Type)) :<|> (("events" :> EventsAPI) :<|> ("cron" :> NamedRoutes (CronAPI :: Type -> Type))) 
RegistryToAPI '['(tableName, payload)] = (tableName :> NamedRoutes (TableAPI payload :: Type -> Type)) :<|> (("queues" :> NamedRoutes (QueuesAPI :: Type -> Type)) :<|> (("events" :> EventsAPI) :<|> ("cron" :> NamedRoutes (CronAPI :: Type -> Type)))) 
RegistryToAPI ('(tableName, payload) ': rest) = (tableName :> NamedRoutes (TableAPI payload :: Type -> Type)) :<|> RegistryToAPI rest 

data TableAPI payload (mode :: k) Source #

API routes for a specific table

Constructors

TableAPI 

Fields

Instances

Instances details
Generic (TableAPI payload mode) Source # 
Instance details

Defined in Arbiter.Servant.API

Associated Types

type Rep (TableAPI payload mode) 
Instance details

Defined in Arbiter.Servant.API

type Rep (TableAPI payload mode) = D1 ('MetaData "TableAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "TableAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("jobs" :> NamedRoutes (JobsAPI payload :: Type -> Type)))) :*: (S1 ('MetaSel ('Just "dlq") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("dlq" :> NamedRoutes (DLQAPI payload :: Type -> Type)))) :*: S1 ('MetaSel ('Just "stats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("stats" :> NamedRoutes (StatsAPI :: Type -> Type)))))))

Methods

from :: TableAPI payload mode -> Rep (TableAPI payload mode) x #

to :: Rep (TableAPI payload mode) x -> TableAPI payload mode #

type Rep (TableAPI payload mode) Source # 
Instance details

Defined in Arbiter.Servant.API

type Rep (TableAPI payload mode) = D1 ('MetaData "TableAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "TableAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("jobs" :> NamedRoutes (JobsAPI payload :: Type -> Type)))) :*: (S1 ('MetaSel ('Just "dlq") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("dlq" :> NamedRoutes (DLQAPI payload :: Type -> Type)))) :*: S1 ('MetaSel ('Just "stats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("stats" :> NamedRoutes (StatsAPI :: Type -> Type)))))))

type EventsAPI = "stream" :> Raw Source #

Events API type - raw WAI handler for SSE streaming

data QueuesAPI (mode :: k) Source #

Queues API routes - list available queues

Constructors

QueuesAPI 

Fields

Instances

Instances details
Generic (QueuesAPI mode) Source # 
Instance details

Defined in Arbiter.Servant.API

Associated Types

type Rep (QueuesAPI mode) 
Instance details

Defined in Arbiter.Servant.API

type Rep (QueuesAPI mode) = D1 ('MetaData "QueuesAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "QueuesAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "listQueues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- Get '[JSON] QueuesResponse))))

Methods

from :: QueuesAPI mode -> Rep (QueuesAPI mode) x #

to :: Rep (QueuesAPI mode) x -> QueuesAPI mode #

type Rep (QueuesAPI mode) Source # 
Instance details

Defined in Arbiter.Servant.API

type Rep (QueuesAPI mode) = D1 ('MetaData "QueuesAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "QueuesAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "listQueues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- Get '[JSON] QueuesResponse))))

data JobsAPI payload (mode :: k) Source #

Jobs API routes - manage jobs in a specific table

Constructors

JobsAPI 

Fields

Instances

Instances details
Generic (JobsAPI payload mode) Source # 
Instance details

Defined in Arbiter.Servant.API

Associated Types

type Rep (JobsAPI payload mode) 
Instance details

Defined in Arbiter.Servant.API

type Rep (JobsAPI payload mode) = D1 ('MetaData "JobsAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobsAPI" 'PrefixI 'True) (((S1 ('MetaSel ('Just "listJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "group_key" Text :> (QueryParam "parent_id" Int64 :> (QueryParam "suspended" Bool :> Get '[JSON] (JobsResponse payload)))))))) :*: (S1 ('MetaSel ('Just "insertJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (ReqBody '[JSON] (ApiJobWrite payload) :> Post '[JSON] (JobResponse payload)))) :*: S1 ('MetaSel ('Just "insertJobsBatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("batch" :> (ReqBody '[JSON] (BatchInsertRequest payload) :> Post '[JSON] (BatchInsertResponse payload))))))) :*: (S1 ('MetaSel ('Just "getJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> Get '[JSON] (JobResponse payload)))) :*: (S1 ('MetaSel ('Just "getInFlightJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("in-flight" :> (QueryParam "limit" Int :> (QueryParam "offset" Int :> Get '[JSON] (JobsResponse payload)))))) :*: S1 ('MetaSel ('Just "cancelJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> DeleteNoContent)))))) :*: ((S1 ('MetaSel ('Just "promoteJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("promote" :> PostNoContent)))) :*: (S1 ('MetaSel ('Just "moveToDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("move-to-dlq" :> PostNoContent)))) :*: S1 ('MetaSel ('Just "pauseChildren") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("pause-children" :> PostNoContent)))))) :*: (S1 ('MetaSel ('Just "resumeChildren") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("resume-children" :> PostNoContent)))) :*: (S1 ('MetaSel ('Just "suspendJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("suspend" :> PostNoContent)))) :*: S1 ('MetaSel ('Just "resumeJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("resume" :> PostNoContent)))))))))

Methods

from :: JobsAPI payload mode -> Rep (JobsAPI payload mode) x #

to :: Rep (JobsAPI payload mode) x -> JobsAPI payload mode #

type Rep (JobsAPI payload mode) Source # 
Instance details

Defined in Arbiter.Servant.API

type Rep (JobsAPI payload mode) = D1 ('MetaData "JobsAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobsAPI" 'PrefixI 'True) (((S1 ('MetaSel ('Just "listJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "group_key" Text :> (QueryParam "parent_id" Int64 :> (QueryParam "suspended" Bool :> Get '[JSON] (JobsResponse payload)))))))) :*: (S1 ('MetaSel ('Just "insertJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (ReqBody '[JSON] (ApiJobWrite payload) :> Post '[JSON] (JobResponse payload)))) :*: S1 ('MetaSel ('Just "insertJobsBatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("batch" :> (ReqBody '[JSON] (BatchInsertRequest payload) :> Post '[JSON] (BatchInsertResponse payload))))))) :*: (S1 ('MetaSel ('Just "getJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> Get '[JSON] (JobResponse payload)))) :*: (S1 ('MetaSel ('Just "getInFlightJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("in-flight" :> (QueryParam "limit" Int :> (QueryParam "offset" Int :> Get '[JSON] (JobsResponse payload)))))) :*: S1 ('MetaSel ('Just "cancelJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> DeleteNoContent)))))) :*: ((S1 ('MetaSel ('Just "promoteJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("promote" :> PostNoContent)))) :*: (S1 ('MetaSel ('Just "moveToDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("move-to-dlq" :> PostNoContent)))) :*: S1 ('MetaSel ('Just "pauseChildren") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("pause-children" :> PostNoContent)))))) :*: (S1 ('MetaSel ('Just "resumeChildren") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("resume-children" :> PostNoContent)))) :*: (S1 ('MetaSel ('Just "suspendJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("suspend" :> PostNoContent)))) :*: S1 ('MetaSel ('Just "resumeJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("resume" :> PostNoContent)))))))))

data DLQAPI payload (mode :: k) Source #

DLQ API routes - manage failed jobs in a specific table

Constructors

DLQAPI 

Fields

Instances

Instances details
Generic (DLQAPI payload mode) Source # 
Instance details

Defined in Arbiter.Servant.API

Associated Types

type Rep (DLQAPI payload mode) 
Instance details

Defined in Arbiter.Servant.API

type Rep (DLQAPI payload mode) = D1 ('MetaData "DLQAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DLQAPI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "listDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "parent_id" Int64 :> (QueryParam "group_key" Text :> Get '[JSON] (DLQResponse payload))))))) :*: S1 ('MetaSel ('Just "retryFromDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("retry" :> PostNoContent))))) :*: (S1 ('MetaSel ('Just "deleteDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> DeleteNoContent))) :*: S1 ('MetaSel ('Just "deleteDLQBatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("batch-delete" :> (ReqBody '[JSON] BatchDeleteRequest :> Post '[JSON] BatchDeleteResponse)))))))

Methods

from :: DLQAPI payload mode -> Rep (DLQAPI payload mode) x #

to :: Rep (DLQAPI payload mode) x -> DLQAPI payload mode #

type Rep (DLQAPI payload mode) Source # 
Instance details

Defined in Arbiter.Servant.API

type Rep (DLQAPI payload mode) = D1 ('MetaData "DLQAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DLQAPI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "listDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "parent_id" Int64 :> (QueryParam "group_key" Text :> Get '[JSON] (DLQResponse payload))))))) :*: S1 ('MetaSel ('Just "retryFromDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("retry" :> PostNoContent))))) :*: (S1 ('MetaSel ('Just "deleteDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> DeleteNoContent))) :*: S1 ('MetaSel ('Just "deleteDLQBatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("batch-delete" :> (ReqBody '[JSON] BatchDeleteRequest :> Post '[JSON] BatchDeleteResponse)))))))

data StatsAPI (mode :: k) Source #

Stats API routes - queue statistics for a specific table

Constructors

StatsAPI 

Fields

Instances

Instances details
Generic (StatsAPI mode) Source # 
Instance details

Defined in Arbiter.Servant.API

Associated Types

type Rep (StatsAPI mode) 
Instance details

Defined in Arbiter.Servant.API

type Rep (StatsAPI mode) = D1 ('MetaData "StatsAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatsAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "getStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- Get '[JSON] StatsResponse))))

Methods

from :: StatsAPI mode -> Rep (StatsAPI mode) x #

to :: Rep (StatsAPI mode) x -> StatsAPI mode #

type Rep (StatsAPI mode) Source # 
Instance details

Defined in Arbiter.Servant.API

type Rep (StatsAPI mode) = D1 ('MetaData "StatsAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatsAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "getStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- Get '[JSON] StatsResponse))))

data CronAPI (mode :: k) Source #

Cron API routes - manage cron schedules

Constructors

CronAPI 

Fields

Instances

Instances details
Generic (CronAPI mode) Source # 
Instance details

Defined in Arbiter.Servant.API

Associated Types

type Rep (CronAPI mode) 
Instance details

Defined in Arbiter.Servant.API

type Rep (CronAPI mode) = D1 ('MetaData "CronAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "listSchedules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("schedules" :> Get '[JSON] CronSchedulesResponse))) :*: S1 ('MetaSel ('Just "updateSchedule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("schedules" :> (Capture "name" Text :> (ReqBody '[JSON] CronScheduleUpdate :> Patch '[JSON] CronScheduleRow)))))))

Methods

from :: CronAPI mode -> Rep (CronAPI mode) x #

to :: Rep (CronAPI mode) x -> CronAPI mode #

type Rep (CronAPI mode) Source # 
Instance details

Defined in Arbiter.Servant.API

type Rep (CronAPI mode) = D1 ('MetaData "CronAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "listSchedules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("schedules" :> Get '[JSON] CronSchedulesResponse))) :*: S1 ('MetaSel ('Just "updateSchedule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("schedules" :> (Capture "name" Text :> (ReqBody '[JSON] CronScheduleUpdate :> Patch '[JSON] CronScheduleRow)))))))

Request Types

newtype ApiJobWrite payload Source #

Write-side job type for REST API insertion.

Accepts payload, groupKey, priority, notVisibleUntil, dedupKey, and maxAttempts. Fields like parentId, isRollup, and suspended are managed internally and cannot be set through the REST API.

Constructors

ApiJobWrite 

Fields

Instances

Instances details
FromJSON payload => FromJSON (ApiJobWrite payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

parseJSON :: Value -> Parser (ApiJobWrite payload)

parseJSONList :: Value -> Parser [ApiJobWrite payload]

omittedField :: Maybe (ApiJobWrite payload)

ToJSON payload => ToJSON (ApiJobWrite payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

toJSON :: ApiJobWrite payload -> Value

toEncoding :: ApiJobWrite payload -> Encoding

toJSONList :: [ApiJobWrite payload] -> Value

toEncodingList :: [ApiJobWrite payload] -> Encoding

omitField :: ApiJobWrite payload -> Bool

Show payload => Show (ApiJobWrite payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

showsPrec :: Int -> ApiJobWrite payload -> ShowS #

show :: ApiJobWrite payload -> String #

showList :: [ApiJobWrite payload] -> ShowS #

Eq payload => Eq (ApiJobWrite payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

(==) :: ApiJobWrite payload -> ApiJobWrite payload -> Bool #

(/=) :: ApiJobWrite payload -> ApiJobWrite payload -> Bool #

Response Types

data QueuesResponse Source #

Queues list response

Constructors

QueuesResponse 

Fields

Instances

Instances details
FromJSON QueuesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

parseJSON :: Value -> Parser QueuesResponse

parseJSONList :: Value -> Parser [QueuesResponse]

omittedField :: Maybe QueuesResponse

ToJSON QueuesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Generic QueuesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Associated Types

type Rep QueuesResponse 
Instance details

Defined in Arbiter.Servant.Types

type Rep QueuesResponse = D1 ('MetaData "QueuesResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "QueuesResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "queues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))
Show QueuesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Eq QueuesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep QueuesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep QueuesResponse = D1 ('MetaData "QueuesResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "QueuesResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "queues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Text])))

data JobResponse payload Source #

Response wrapper for job operations

Constructors

JobResponse 

Fields

Instances

Instances details
FromJSON payload => FromJSON (JobResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

parseJSON :: Value -> Parser (JobResponse payload)

parseJSONList :: Value -> Parser [JobResponse payload]

omittedField :: Maybe (JobResponse payload)

ToJSON payload => ToJSON (JobResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

toJSON :: JobResponse payload -> Value

toEncoding :: JobResponse payload -> Encoding

toJSONList :: [JobResponse payload] -> Value

toEncodingList :: [JobResponse payload] -> Encoding

omitField :: JobResponse payload -> Bool

Generic (JobResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Associated Types

type Rep (JobResponse payload) 
Instance details

Defined in Arbiter.Servant.Types

type Rep (JobResponse payload) = D1 ('MetaData "JobResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "job") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApiJob payload))))

Methods

from :: JobResponse payload -> Rep (JobResponse payload) x #

to :: Rep (JobResponse payload) x -> JobResponse payload #

Show payload => Show (JobResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

showsPrec :: Int -> JobResponse payload -> ShowS #

show :: JobResponse payload -> String #

showList :: [JobResponse payload] -> ShowS #

Eq payload => Eq (JobResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

(==) :: JobResponse payload -> JobResponse payload -> Bool #

(/=) :: JobResponse payload -> JobResponse payload -> Bool #

type Rep (JobResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep (JobResponse payload) = D1 ('MetaData "JobResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "job") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApiJob payload))))

data JobsResponse payload Source #

Response wrapper for multiple jobs

Instances

Instances details
FromJSON payload => FromJSON (JobsResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

parseJSON :: Value -> Parser (JobsResponse payload)

parseJSONList :: Value -> Parser [JobsResponse payload]

omittedField :: Maybe (JobsResponse payload)

ToJSON payload => ToJSON (JobsResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

toJSON :: JobsResponse payload -> Value

toEncoding :: JobsResponse payload -> Encoding

toJSONList :: [JobsResponse payload] -> Value

toEncodingList :: [JobsResponse payload] -> Encoding

omitField :: JobsResponse payload -> Bool

Generic (JobsResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Associated Types

type Rep (JobsResponse payload) 
Instance details

Defined in Arbiter.Servant.Types

type Rep (JobsResponse payload) = D1 ('MetaData "JobsResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobsResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ApiJob payload]) :*: (S1 ('MetaSel ('Just "jobsTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "jobsOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "jobsLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "childCounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int64 Int64))) :*: (S1 ('MetaSel ('Just "pausedParents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int64]) :*: S1 ('MetaSel ('Just "dlqChildCounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int64 Int64))))))

Methods

from :: JobsResponse payload -> Rep (JobsResponse payload) x #

to :: Rep (JobsResponse payload) x -> JobsResponse payload #

Show payload => Show (JobsResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

showsPrec :: Int -> JobsResponse payload -> ShowS #

show :: JobsResponse payload -> String #

showList :: [JobsResponse payload] -> ShowS #

Eq payload => Eq (JobsResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

(==) :: JobsResponse payload -> JobsResponse payload -> Bool #

(/=) :: JobsResponse payload -> JobsResponse payload -> Bool #

type Rep (JobsResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep (JobsResponse payload) = D1 ('MetaData "JobsResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobsResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ApiJob payload]) :*: (S1 ('MetaSel ('Just "jobsTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "jobsOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "jobsLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "childCounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int64 Int64))) :*: (S1 ('MetaSel ('Just "pausedParents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int64]) :*: S1 ('MetaSel ('Just "dlqChildCounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int64 Int64))))))

data DLQResponse payload Source #

Response wrapper for DLQ jobs

Constructors

DLQResponse 

Fields

Instances

Instances details
FromJSON payload => FromJSON (DLQResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

parseJSON :: Value -> Parser (DLQResponse payload)

parseJSONList :: Value -> Parser [DLQResponse payload]

omittedField :: Maybe (DLQResponse payload)

ToJSON payload => ToJSON (DLQResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

toJSON :: DLQResponse payload -> Value

toEncoding :: DLQResponse payload -> Encoding

toJSONList :: [DLQResponse payload] -> Value

toEncodingList :: [DLQResponse payload] -> Encoding

omitField :: DLQResponse payload -> Bool

Generic (DLQResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Associated Types

type Rep (DLQResponse payload) 
Instance details

Defined in Arbiter.Servant.Types

type Rep (DLQResponse payload) = D1 ('MetaData "DLQResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DLQResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dlqJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ApiDLQJob payload]) :*: S1 ('MetaSel ('Just "dlqTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "dlqOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "dlqLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

Methods

from :: DLQResponse payload -> Rep (DLQResponse payload) x #

to :: Rep (DLQResponse payload) x -> DLQResponse payload #

Show payload => Show (DLQResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

showsPrec :: Int -> DLQResponse payload -> ShowS #

show :: DLQResponse payload -> String #

showList :: [DLQResponse payload] -> ShowS #

Eq payload => Eq (DLQResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

(==) :: DLQResponse payload -> DLQResponse payload -> Bool #

(/=) :: DLQResponse payload -> DLQResponse payload -> Bool #

type Rep (DLQResponse payload) Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep (DLQResponse payload) = D1 ('MetaData "DLQResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DLQResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dlqJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ApiDLQJob payload]) :*: S1 ('MetaSel ('Just "dlqTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "dlqOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "dlqLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

data StatsResponse Source #

Queue statistics response

Constructors

StatsResponse 

Instances

Instances details
FromJSON StatsResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Methods

parseJSON :: Value -> Parser StatsResponse

parseJSONList :: Value -> Parser [StatsResponse]

omittedField :: Maybe StatsResponse

ToJSON StatsResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Generic StatsResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Associated Types

type Rep StatsResponse 
Instance details

Defined in Arbiter.Servant.Types

type Rep StatsResponse = D1 ('MetaData "StatsResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatsResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "stats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QueueStats) :*: S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show StatsResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Eq StatsResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep StatsResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep StatsResponse = D1 ('MetaData "StatsResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatsResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "stats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QueueStats) :*: S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data CronSchedulesResponse Source #

Cron schedules response

Instances

Instances details
FromJSON CronSchedulesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

ToJSON CronSchedulesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Generic CronSchedulesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Associated Types

type Rep CronSchedulesResponse 
Instance details

Defined in Arbiter.Servant.Types

type Rep CronSchedulesResponse = D1 ('MetaData "CronSchedulesResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronSchedulesResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "cronSchedules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [CronScheduleRow])))
Show CronSchedulesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

Eq CronSchedulesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep CronSchedulesResponse Source # 
Instance details

Defined in Arbiter.Servant.Types

type Rep CronSchedulesResponse = D1 ('MetaData "CronSchedulesResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronSchedulesResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "cronSchedules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [CronScheduleRow])))

data CronScheduleRow #

A row from the cron_schedules table.

Instances

Instances details
FromJSON CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

ToJSON CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

Generic CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

Show CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

Eq CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

FromRow CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

Methods

fromRow :: RowParser CronScheduleRow

ToRow CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

Methods

toRow :: CronScheduleRow -> [Action]

type Rep CronScheduleRow 
Instance details

Defined in Arbiter.Core.CronSchedule

data CronScheduleUpdate #

Patch update for a cron schedule.

Each field uses Maybe (Maybe a):

  • Nothing = don't change
  • Just Nothing = reset to default (set column to NULL)
  • Just (Just x) = set to x

Instances

Instances details
FromJSON CronScheduleUpdate

Manual instance to distinguish missing keys from null values.

  • Key missing → Nothing (don't change)
  • Key present with nullJust Nothing (reset to default)
  • Key present with value → Just (Just x) (set override)
Instance details

Defined in Arbiter.Core.CronSchedule

ToJSON CronScheduleUpdate 
Instance details

Defined in Arbiter.Core.CronSchedule

Generic CronScheduleUpdate 
Instance details

Defined in Arbiter.Core.CronSchedule

Associated Types

type Rep CronScheduleUpdate 
Instance details

Defined in Arbiter.Core.CronSchedule

type Rep CronScheduleUpdate = D1 ('MetaData "CronScheduleUpdate" "Arbiter.Core.CronSchedule" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronScheduleUpdate" 'PrefixI 'True) (S1 ('MetaSel ('Just "overrideExpression") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: (S1 ('MetaSel ('Just "overrideOverlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: S1 ('MetaSel ('Just "enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))
Show CronScheduleUpdate 
Instance details

Defined in Arbiter.Core.CronSchedule

Eq CronScheduleUpdate 
Instance details

Defined in Arbiter.Core.CronSchedule

type Rep CronScheduleUpdate 
Instance details

Defined in Arbiter.Core.CronSchedule

type Rep CronScheduleUpdate = D1 ('MetaData "CronScheduleUpdate" "Arbiter.Core.CronSchedule" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronScheduleUpdate" 'PrefixI 'True) (S1 ('MetaSel ('Just "overrideExpression") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: (S1 ('MetaSel ('Just "overrideOverlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: S1 ('MetaSel ('Just "enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))