From d5f345dadd6f19734b2d9c195550de1a46c24d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 4 Dec 2023 10:31:59 +0100 Subject: [PATCH] fix: Update documentation and names --- hook-common/src/pgqueue.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hook-common/src/pgqueue.rs b/hook-common/src/pgqueue.rs index 7204f97..89aab7e 100644 --- a/hook-common/src/pgqueue.rs +++ b/hook-common/src/pgqueue.rs @@ -499,16 +499,24 @@ pub type PgQueueResult = std::result::Result; impl PgQueue { /// Initialize a new PgQueue backed by table in PostgreSQL. + /// + /// # Arguments + /// + /// * `queue_name`: A name for the queue we are going to initialize. + /// * `table_name`: The name for the table the queue will use in PostgreSQL. + /// * `url`: A URL pointing to where the PostgreSQL database is hosted. + /// * `worker_name`: The name of the worker that is operating with this queue. + /// * `retry_policy`: A retry policy to pass to jobs from this queue. pub async fn new( - name: &str, - table: &str, + queue_name: &str, + table_name: &str, url: &str, - worker: &str, + worker_name: &str, retry_policy: RetryPolicy, ) -> PgQueueResult { - let name = name.to_owned(); - let table = table.to_owned(); - let worker = worker.to_owned(); + let name = queue_name.to_owned(); + let table = table_name.to_owned(); + let worker = worker_name.to_owned(); let pool = PgPoolOptions::new() .connect(url) .await