Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlpfy-0000mB-V4 for pgsql-general@arkaria.postgresql.org; Fri, 12 Jul 2019 07:09:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hlpfx-0008Ul-3U for pgsql-general@arkaria.postgresql.org; Fri, 12 Jul 2019 07:09:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hlpfw-0008Qr-5a for pgsql-general@lists.postgresql.org; Fri, 12 Jul 2019 07:09:00 +0000 Received: from m15-114.126.com ([220.181.15.114]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hlpfp-0006ko-4o for pgsql-general@lists.postgresql.org; Fri, 12 Jul 2019 07:08:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Message-Id:Mime-Version:Subject:Date; bh=1vFHD DczEtW8t/8q2ZwBNckzngn5xZ4567znHRTX/xc=; b=avCI/ik1ofGjzyaF8PWFQ 0mUVFkT/WC5Rhv3pvIZ2H29locbNDYsxMP+LSOetZJKKPivYwWoaV2fe4kpIO6fr FA9YwWbW/6OwDIhuP0dbkoNCn7cWjOvHU2u3qRlMBySbUXKUjVdyZ70rReZU6Hjw yl3D0mZT0xykVK4rM9YlbM= Received: from [172.20.10.3] (unknown [223.104.3.250]) by smtp7 (Coremail) with SMTP id DsmowACn1fr7MShdKHHDJQ--.37808S3; Fri, 12 Jul 2019 15:08:45 +0800 (CST) From: lilu Message-Id: <3C9E7EFE-2655-487B-AC54-62BF27CADEC4@126.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_D4721902-6CD9-45B5-9932-7CDC6832FBFB" Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: How to run a task continuously in the background Date: Fri, 12 Jul 2019 15:08:37 +0800 In-Reply-To: Cc: "pgsql-general@lists.postgresql.org" To: Dirk Mika References: <7932668C-EA48-436B-AA15-DB7C8446D57F@mikatiming.de> X-Mailer: Apple Mail (2.3273) X-CM-TRANSID: DsmowACn1fr7MShdKHHDJQ--.37808S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gw1rKw48GrWkCFWxuryUKFg_yoWkGFb_uF yjyw17Cw4fta9rJ3W7W3WUtrZxW3WUKrn5u34fWrn0gw47ZasrWFW5Gr1UuFyfGrySqFn8 GF9I9rsF9w4avjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0IksDUUUUU== X-Originating-IP: [223.104.3.250] X-CM-SenderInfo: 5ol0xtxrbiz5a6rslhhfrp/1tbiOh7vNVuvmbfrlAAAsb List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_D4721902-6CD9-45B5-9932-7CDC6832FBFB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > =E5=9C=A8 2019=E5=B9=B47=E6=9C=8812=E6=97=A5=EF=BC=8C=E4=B8=8B=E5=8D=881= :06=EF=BC=8CDirk Mika =E5=86=99=E9=81=93=EF=BC=9A= >=20 > =20 > A cron job will only run once a minute, not wake up every second.=20 > =20 > Right, that=E2=80=99s an issue. > =20 > 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. =20 > =20 > 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. > =20 > BR > Dirk > --=20 > Dirk Mika > Software Developer >=20 > >=20 > mika:timing GmbH > Strundepark - K=C3=BCrtener Str. 11b > 51465 Bergisch Gladbach > Germany >=20 >=20 > fon +49 2202 2401-1197=20 > dirk.mika@mikatiming.de > www.mikatiming.de >=20 > AG K=C3=B6ln HRB 47509 * WEEE-Reg.-Nr. DE 90029884=20 > Gesch=C3=A4ftsf=C3=BChrer: Harald Mika, J=C3=B6rg Mika >=20 > = --Apple-Mail=_D4721902-6CD9-45B5-9932-7CDC6832FBFB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
=E5=9C=A8 2019=E5=B9=B47=E6=9C=8812=E6=97=A5=EF=BC=8C=E4=B8=8B=E5= =8D=881:06=EF=BC=8CDirk Mika <Dirk.Mika@mikatiming.de> =E5=86=99=E9=81=93=EF=BC=9A
 
A = cron job will only run once a minute, not wake up every = second. 
 
Right, that=E2=80=99s 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

<image001_= d0a5cf51-5dd3-4ff5-b428-1016a6d95a0f.png>

mika:timing GmbH
Strundepark - K=C3=BCrtener Str. 11b
51465 Bergisch = Gladbach
Germany

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

AG K=C3=B6ln= HRB 47509 * WEEE-Reg.-Nr. DE 90029884 
Gesch=C3=A4ftsf=C3=BChrer: Harald Mika, J=C3=B6rg = Mika


= --Apple-Mail=_D4721902-6CD9-45B5-9932-7CDC6832FBFB--

<CCh2U_f27a5c= e6-8556-4db1-8aa4-fd610d6e9efe.jpg>