pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brent Wood <pcreso@yahoo.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
To: Dirk Mika <Dirk.Mika@mikatiming.de>
Subject: Re: How to run a task continuously in the background
Date: Fri, 12 Jul 2019 05:22:11 +0000 (UTC)
Message-ID: <1296430554.760012.1562908931896@mail.yahoo.com> (raw)
In-Reply-To: <D49B7AAD-5EC3-4D62-A263-E22E6633C807@mikatiming.de>
References: <7932668C-EA48-436B-AA15-DB7C8446D57F@mikatiming.de>
	<E9FA92C2921F31408041863B74EE4C2001BD810545@CCPMAILDAG03.cantab.local>
	<CAOzAquKb+O3iu0pVBonDDSS8SH=a4Wa4hmYFxAbTwUCi7Hxjhg@mail.gmail.com>
	<D49B7AAD-5EC3-4D62-A263-E22E6633C807@mikatiming.de>

 You could perhaps tweak the code for pg_cron or pg_agent for a custom solution that supports a finer time resolution?

    On Friday, July 12, 2019, 5:06:42 PM GMT+12, Dirk Mika <Dirk.Mika@mikatiming.de> wrote:  
 
 
  
 
A cron job will only run once a minute, not wake up every second. 
 
  
 
Right, that’s an issue.

  
 

But you could write a PHP program that does a one-second sleep before checking if there's something to do, and a batch job that runs periodically to see if the PHP program is running, and if not, launch it.   
  
 
I would like to avoid external programs if possible. In the current Oracle environment, there are potentially multiple schemas on a server in which processing can be active. And processing can be started, monitored and stopped from a client application. And only for the schema with which the application is connected.
 
  
 
BR
 
Dirk
 
| -- 
Dirk Mika
Software Developer

 |
| 


mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany


 |
| 
fon +49 2202 2401-1197
dirk.mika@mikatiming.de
www.mikatiming.de


 |
| AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika |





|  | 

 |


  
  

Attachments:

image001_d0a5cf51-5dd3-4ff5-b428-1016a6d95a0f.png (image/png, 1.7K) download view image
CCh2U_f27a5ce6-8556-4db1-8aa4-fd610d6e9efe.jpg (image/jpeg, 107.2K) download view image

view thread (26+ messages)  latest in thread

Message-ID: <1296430554.760012.1562908931896@mail.yahoo.com>
Permalink:  ../1296430554.760012.1562908931896@mail.yahoo.com/
Also on:    postgresql.org/message-id/1296430554.760012.1562908931896@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pcreso@yahoo.com, Dirk.Mika@mikatiming.de
  Subject: Re: How to run a task continuously in the background
  In-Reply-To: <1296430554.760012.1562908931896@mail.yahoo.com>
  References: <7932668C-EA48-436B-AA15-DB7C8446D57F@mikatiming.de> <E9FA92C2921F31408041863B74EE4C2001BD810545@CCPMAILDAG03.cantab.local> <CAOzAquKb+O3iu0pVBonDDSS8SH=a4Wa4hmYFxAbTwUCi7Hxjhg@mail.gmail.com> <D49B7AAD-5EC3-4D62-A263-E22E6633C807@mikatiming.de> <1296430554.760012.1562908931896@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox