-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A distributed worker backend for powerqueu -- -- A distributed worker backend for powerqueu @package powerqueue-distributed @version 0.1.0.0 module Data.PowerQueue.Worker.Distributed newtype AuthToken AuthToken :: Text -> AuthToken [unAuthToken] :: AuthToken -> Text newtype AppVersion AppVersion :: Word64 -> AppVersion [unAppVersion] :: AppVersion -> Word64 -- | Work master configuration data WorkMasterConfig WorkMasterConfig :: !Text -> !Int -> !AuthToken -> !AppVersion -> !(ServerErrorEvent -> IO ()) -> WorkMasterConfig [wmc_host] :: WorkMasterConfig -> !Text [wmc_port] :: WorkMasterConfig -> !Int -- | reject all client that do not send this token. See -- wnc_authToken [wmc_authToken] :: WorkMasterConfig -> !AuthToken -- | required app version for all clients. See wnc_appVersion [wmc_appVersion] :: WorkMasterConfig -> !AppVersion -- | a (non-)critical error occured. Useful for logging [wmc_errorHook] :: WorkMasterConfig -> !(ServerErrorEvent -> IO ()) -- | Work master errors data ServerErrorEvent SeeClientDisconnect :: ServerErrorEvent SeeClientBadVersion :: !AppVersion -> ServerErrorEvent SeeInvalidPayload :: !String -> ServerErrorEvent -- | Launch a work master on current thread that will distribute all -- incoming work on a queue to connecting worker nodes launched via -- launchWorkNode launchWorkMaster :: forall j. Serialize j => WorkMasterConfig -> QueueBackend j -> IO () -- | Work node configuration data WorkNodeConfig WorkNodeConfig :: !Text -> !Int -> !AuthToken -> !AppVersion -> !(ClientErrorEvent -> IO ()) -> !(IO ()) -> WorkNodeConfig -- | host where the work master is running. See wmc_host [wnc_hostMaster] :: WorkNodeConfig -> !Text -- | port of work master. See wmc_port [wnc_portMaster] :: WorkNodeConfig -> !Int -- | the authentification token. MUST match the masters -- wmc_authToken! [wnc_authToken] :: WorkNodeConfig -> !AuthToken -- | the current app version. MUST match the masters wmc_appVersion! [wnc_appVersion] :: WorkNodeConfig -> !AppVersion -- | a (non-)critical error occured. Useful for logging [wnc_errorHook] :: WorkNodeConfig -> !(ClientErrorEvent -> IO ()) -- | called once when ready for draining [wnc_readyHook] :: WorkNodeConfig -> !(IO ()) -- | Work node async errors data ClientErrorEvent CeeConnClosed :: ClientErrorEvent CeeBadAuthResponse :: ClientErrorEvent CeeInvalidAuthResponse :: ClientErrorEvent CeeInvalidDrainResponse :: ClientErrorEvent CeeServerBadVersion :: !AppVersion -> ClientErrorEvent CeeInvalidPayload :: !String -> ClientErrorEvent CeeWorkerException :: !String -> ClientErrorEvent -- | Launch a worker node on the current thread connecting to a work master -- launched with launchWorkMaster launchWorkNode :: forall j. Serialize j => WorkNodeConfig -> QueueWorker j -> IO () launchReconnectingWorkNode :: forall j. Serialize j => WorkNodeConfig -> (TimeSpan -> IO ()) -> QueueWorker j -> IO () instance GHC.Classes.Eq Data.PowerQueue.Worker.Distributed.ClientErrorEvent instance GHC.Show.Show Data.PowerQueue.Worker.Distributed.ClientErrorEvent instance GHC.Classes.Eq Data.PowerQueue.Worker.Distributed.ServerErrorEvent instance GHC.Show.Show Data.PowerQueue.Worker.Distributed.ServerErrorEvent instance GHC.Generics.Generic (Data.PowerQueue.Worker.Distributed.ServerPayload j) instance GHC.Generics.Generic Data.PowerQueue.Worker.Distributed.ClientPayload instance GHC.Classes.Ord Data.PowerQueue.Worker.Distributed.AppVersion instance GHC.Classes.Eq Data.PowerQueue.Worker.Distributed.AppVersion instance GHC.Show.Show Data.PowerQueue.Worker.Distributed.AppVersion instance GHC.Classes.Eq Data.PowerQueue.Worker.Distributed.AuthToken instance GHC.Show.Show Data.PowerQueue.Worker.Distributed.AuthToken instance Data.Serialize.Serialize Data.PowerQueue.Worker.Distributed.AuthToken instance Data.Serialize.Serialize Data.PowerQueue.Worker.Distributed.AppVersion instance Data.Serialize.Serialize Data.PowerQueue.Worker.Distributed.Message instance Data.Serialize.Serialize Data.PowerQueue.Worker.Distributed.ClientPayload instance Data.Serialize.Serialize j => Data.Serialize.Serialize (Data.PowerQueue.Worker.Distributed.ServerPayload j)