X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2DCAC9DC80D for ; Tue, 21 Mar 2006 09:17:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68532-07 for ; Tue, 21 Mar 2006 09:17:26 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from matrix.gatewaynet.com (host2.dynacom.ondsl.gr [62.103.35.210]) by postgresql.org (Postfix) with ESMTP id ADCB69DC877 for ; Tue, 21 Mar 2006 09:17:20 -0400 (AST) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id k2LENIOp026533; Tue, 21 Mar 2006 16:23:18 +0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id k2LENIaV026529; Tue, 21 Mar 2006 16:23:18 +0200 Date: Tue, 21 Mar 2006 16:23:18 +0200 (EET) From: Achilleus Mantzios To: Alexis Paul Bertolini cc: pgsql-sql@postgresql.org Subject: Re: Job queue, how would you implement this? In-Reply-To: <441FF966.2020202@computer.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-7 Content-Transfer-Encoding: 8BIT X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.113 required=5 tests=[AWL=0.113] X-Spam-Score: 0.113 X-Spam-Level: X-Archive-Number: 200603/327 X-Sequence-Number: 24673 O Alexis Paul Bertolini έγραψε στις Mar 21, 2006 : > Dear all, > > I have implemented a job queue table where various apps can add jobs to > the queue and other daemons then execute them. A basic producer-consumer > pattern. Each tuple in the queue has the basic info such as job to be > done, when it should be done, who should do it, a flag marking it completed. > > The consumer thus selects from the queue all jobs who scheduled in the > past (<=CURRENT_TIMESTAMP) and are not flagged. Then flags them upon > succesfull completion. The consumer runs from the command line? (i.e. user-action driven?) > > I now wish to implement repeating scheduled jobs, like "every 5 > minutes", "every morning at 7.00am" and so on. How could I do this? I think the traditional UNIX "at" framework could be a good model (or replacement) of the simpler case, whereas the traditional UNIX "cron" framework could be a good model (or replacement) of the latter case. Your requirements photographically point to the above systems. Are you running on a UNIX machine? > > Any suggestions are welcome and if necessary I can provide you with more > info. > > Thanks > > Alex. > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > -- -Achilleus