Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ThreadType
- data SchemaSyncThreadLog = SchemaSyncThreadLog {
- suelLogLevel :: !LogLevel
- suelThreadType :: !ThreadType
- suelInfo :: !Value
- data ThreadError
- = TEPayloadParse !Text
- | TEQueryError !QErr
- logThreadStarted :: MonadIO m => Logger Hasura -> InstanceId -> ThreadType -> Thread -> m ()
- startSchemaSyncListenerThread :: ForkableMonadIO m => Logger Hasura -> PGPool -> InstanceId -> NonNegative Milliseconds -> TMVar MetadataResourceVersion -> ManagedT m Thread
- startSchemaSyncProcessorThread :: (ForkableMonadIO m, MonadMetadataStorage (MetadataStorageT m), MonadResolveSource m) => Logger Hasura -> Manager -> TMVar MetadataResourceVersion -> SchemaCacheRef -> InstanceId -> ServerConfigCtx -> TVar Bool -> ManagedT m Thread
- forcePut :: TMVar a -> a -> IO ()
- schemaVersionCheckHandler :: PGPool -> TMVar MetadataResourceVersion -> IO (Either QErr ())
- data ErrorState = ErrorState {}
- defaultErrorState :: ErrorState
- updateErrorInState :: ErrorState -> QErr -> MetadataResourceVersion -> ErrorState
- isInErrorState :: ErrorState -> Bool
- toLogError :: ErrorState -> QErr -> MetadataResourceVersion -> Bool
- listener :: MonadIO m => Logger Hasura -> PGPool -> TMVar MetadataResourceVersion -> Milliseconds -> m void
- processor :: forall m void. (ForkableMonadIO m, MonadMetadataStorage (MetadataStorageT m), MonadResolveSource m) => Logger Hasura -> Manager -> TMVar MetadataResourceVersion -> SchemaCacheRef -> InstanceId -> ServerConfigCtx -> TVar Bool -> m void
- refreshSchemaCache :: (MonadIO m, MonadBaseControl IO m, MonadMetadataStorage m, MonadResolveSource m) => MetadataResourceVersion -> InstanceId -> Logger Hasura -> Manager -> SchemaCacheRef -> ThreadType -> ServerConfigCtx -> TVar Bool -> m ()
- logInfo :: MonadIO m => Logger Hasura -> ThreadType -> Value -> m ()
- logError :: (MonadIO m, ToJSON a) => Logger Hasura -> ThreadType -> a -> m ()
- logDebug :: MonadIO m => Logger Hasura -> ThreadType -> String -> m ()
Documentation
data ThreadType Source #
Instances
Eq ThreadType Source # | |
Defined in Hasura.Server.SchemaUpdate (==) :: ThreadType -> ThreadType -> Bool # (/=) :: ThreadType -> ThreadType -> Bool # | |
Show ThreadType Source # | |
Defined in Hasura.Server.SchemaUpdate showsPrec :: Int -> ThreadType -> ShowS # show :: ThreadType -> String # showList :: [ThreadType] -> ShowS # |
data SchemaSyncThreadLog Source #
SchemaSyncThreadLog | |
|
data ThreadError Source #
TEPayloadParse !Text | |
TEQueryError !QErr |
Instances
ToJSON ThreadError Source # | |
Defined in Hasura.Server.SchemaUpdate toJSON :: ThreadError -> Value toEncoding :: ThreadError -> Encoding toJSONList :: [ThreadError] -> Value toEncodingList :: [ThreadError] -> Encoding |
logThreadStarted :: MonadIO m => Logger Hasura -> InstanceId -> ThreadType -> Thread -> m () Source #
startSchemaSyncListenerThread :: ForkableMonadIO m => Logger Hasura -> PGPool -> InstanceId -> NonNegative Milliseconds -> TMVar MetadataResourceVersion -> ManagedT m Thread Source #
An async thread which listen to Postgres notify to enable schema syncing See Note [Schema Cache Sync]
startSchemaSyncProcessorThread :: (ForkableMonadIO m, MonadMetadataStorage (MetadataStorageT m), MonadResolveSource m) => Logger Hasura -> Manager -> TMVar MetadataResourceVersion -> SchemaCacheRef -> InstanceId -> ServerConfigCtx -> TVar Bool -> ManagedT m Thread Source #
An async thread which processes the schema sync events See Note [Schema Cache Sync]
schemaVersionCheckHandler :: PGPool -> TMVar MetadataResourceVersion -> IO (Either QErr ()) Source #
data ErrorState Source #
updateErrorInState :: ErrorState -> QErr -> MetadataResourceVersion -> ErrorState Source #
NOTE: this can be updated to use lenses
isInErrorState :: ErrorState -> Bool Source #
toLogError :: ErrorState -> QErr -> MetadataResourceVersion -> Bool Source #
listener :: MonadIO m => Logger Hasura -> PGPool -> TMVar MetadataResourceVersion -> Milliseconds -> m void Source #
An IO action that listens to postgres for events and pushes them to a Queue, in a loop forever.
processor :: forall m void. (ForkableMonadIO m, MonadMetadataStorage (MetadataStorageT m), MonadResolveSource m) => Logger Hasura -> Manager -> TMVar MetadataResourceVersion -> SchemaCacheRef -> InstanceId -> ServerConfigCtx -> TVar Bool -> m void Source #
An IO action that processes events from Queue, in a loop forever.
refreshSchemaCache :: (MonadIO m, MonadBaseControl IO m, MonadMetadataStorage m, MonadResolveSource m) => MetadataResourceVersion -> InstanceId -> Logger Hasura -> Manager -> SchemaCacheRef -> ThreadType -> ServerConfigCtx -> TVar Bool -> m () Source #