úÎRVOÞ!      None+4>CFILN%Exception thrown from a child thread.!OException thrown to a thread to stop its execution. All exceptions other than ! thrown to threads spawned by  and + are propagated back to the parent thread.CRuns an action that returns a finalizer and performs it at the end.Stop execution of a thread.Modified version of "9 that propagates thrown exceptions to the parent thread.Modified version of #9 that propagates thrown exceptions to the parent thread. !$%&' !$%&'None+4;>CFILN Config of a consumer.‘Name of a database table where jobs are stored. The table needs to have the following columns in order to be suitable for acting as a job queue:hid - represents ID of the job. Needs to be a primary key of the type convertible to text, not nullable.ÿ'run_at - represents the time at which the job will be processed. Needs to be nullable, of the type comparable with now() (TIMESTAMPTZ is recommended). Note: a job with run_at set to NULL is never picked for processing. Useful for storing already processed/expired jobs for debugging purposes.ÿfinished_at - represents the time at which job processing was finished. Needs to be nullable, of the type you can assign now() to (TIMESTAMPTZ is recommended). NULL means that the job was either never processed or that it was started and failed at least once.“reserved_by - represents ID of the consumer that currently processes the job. Needs to be nullable, of the type corresponding to id in the table  W. It's recommended (though not neccessary) to make it a foreign key referencing id in   with ON DELETE SET NULL.Õattempts - represents number of job processing attempts made so far. Needs to be not nullable, of type INTEGER. Initial value of a fresh job should be 0, therefore it makes sense to make the column default to 0. vName of a database table where registered consumers are stored. The table itself needs to have the following columns:kid - represents ID of a consumer. Needs to be a primary key of the type SERIAL or BIGSERIAL (recommended). name - represents jobs table of the consumer. Needs to be not nullable, of type TEXT. Allows for tracking consumers of multiple queues with one table. Set to .ÿ?last_activity - represents the last registered activity of the consumer. It's updated periodically by all currently running consumers every 30 seconds to prove that they are indeed running. They also check for the registered consumers that didn't update their status for a minute. If any such consumers are found, they are presumed to be not working and all the jobs reserved by them are released. This prevents the situation where a consumer with reserved jobs silently fails (e.g. because of a hard crash) and these jobs stay locked forever, yet are never processed. LFields needed to be selected from the jobs table in order to assemble a job. 7Function that transforms the list of fields into a job. 3Selector for taking out job ID from the job object. FNotification channel used for listening for incoming jobs. If set to (K, no listening is performed and jobs are selected from the database every  microseconds.±Timeout of listening for incoming jobs, in microseconds. The consumer checks between the timeouts if there are any jobs in the database that needs to be processed, so even if   is )Ý, you need to set it to a reasonable number if the jobs you process may fail and are retried later, as there is no way to signal with a notification that a job will need to be performed e.g. in 5 minutes. However, if   is )ƒ and jobs are never retried, you can set it to -1, then listening will never timeout. Otherwise it needs to be a positive number.9Maximum amount of jobs that can be processed in parallel.Function that processes a job.²Action taken if job processing function throws an exception. Note that if this action throws an exception, the consumer goes down, so it's best to ensure that it doesn't throw.Result of processing a job.)Action to take after a job was processed.     None+4>CFILNID of a consumer.YRegister consumer in the consumers table, so that it can reserve jobs using acquired ID.$Unregister consumer with a given ID.*+,-*+,-None+4>CFILN¤Run the consumer. The purpose of the returned monadic action is to wait for currently processed jobs and clean up. This function is best used in conjunction with ( to seamlessly handle the finalization.bSpawn a thread that generates signals for the dispatcher to probe the database for incoming jobs.^Spawn a thread that monitors working consumers for activity and periodically updates its own. 0Spawn a thread that reserves and processes jobs. ./   ./None+4>CFILN 0       !"#$%&'()*(%+,-./0./1234567consu_7d96Stcu7QIA06nzPwVuzf#Database.PostgreSQL.Consumers.Utils$Database.PostgreSQL.Consumers.Config&Database.PostgreSQL.Consumers.Consumer(Database.PostgreSQL.Consumers.ComponentsDatabase.PostgreSQL.Consumers ThrownFromfinalize stopExecutionforkPgforkPConsumerConfig ccJobsTableccConsumersTableccJobSelectors ccJobFetcher ccJobIndexccNotificationChannelccNotificationTimeoutccMaxRunningJobs ccProcessJob ccOnExceptionResultOkFailedAction MarkProcessed RerunAfterRerunAtRemove ConsumerIDregisterConsumerunregisterConsumer runConsumer spawnListener spawnMonitorspawnDispatcher StopExecutionlifte_I9TR5C3q4Z0Cg36jJy4jWTControl.Concurrent.Liftedforklifte_4saJAmw668yLXHbevzYuEm&Control.Concurrent.Thread.Group.LiftedforkImpl$fExceptionThrownFrom$fExceptionStopExecutionbaseGHC.BaseNothingJust$fShowConsumerID$fToSQLConsumerID$fFromSQLConsumerIDts atomically