Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 11586 invoked from network); 26 Jul 2010 21:29:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Jul 2010 21:29:22 -0000 Received: (qmail 9675 invoked by uid 500); 26 Jul 2010 21:29:20 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 9601 invoked by uid 500); 26 Jul 2010 21:29:19 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 9593 invoked by uid 99); 26 Jul 2010 21:29:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 21:29:19 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of markjreed@gmail.com designates 74.125.82.180 as permitted sender) Received: from [74.125.82.180] (HELO mail-wy0-f180.google.com) (74.125.82.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jul 2010 21:29:13 +0000 Received: by wyb33 with SMTP id 33so3602279wyb.11 for ; Mon, 26 Jul 2010 14:28:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=P3lE987/niQdzfagn5ksV586K2Tx6KbHcB7E/13yWh4=; b=LG64RNewApbarmua04jgMaaWuyv26zNg6NAj91r8Q7/xQUlXYZytlsEVqr5gRaTkAV 7TwbCYsGGC7sAHSgDj48vUTSx5F5UI7iDO6CuASQbhrggT9g88o37rJRk1MOnu0JV3MC KXNGZZ7FP51vnmo362uh47OztzfPBLu97VB88= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=WgRZhD0wNc5k1y3JvuydvmEg3UZafUO04mfjeJz60rRG+2S/sNAqQbPkLhMMPBVju5 0Xu74dznS9qr0n0CeFkL83mb8HIiecJWJQa0DUr52PIeuC7YPUNsUWzDBHTOjiddWP9X zNXW8H033JDyAu1Qq3uMh0/bsw+csw3+zeSwo= MIME-Version: 1.0 Received: by 10.227.68.145 with SMTP id v17mr3861523wbi.159.1280179733315; Mon, 26 Jul 2010 14:28:53 -0700 (PDT) Received: by 10.216.87.200 with HTTP; Mon, 26 Jul 2010 14:28:53 -0700 (PDT) In-Reply-To: References: Date: Mon, 26 Jul 2010 17:28:53 -0400 Message-ID: Subject: Re: scheduled tasks From: "Mark J. Reed" To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org The "fun and ease of Python" is not at issue here. Glad you're having fun programming in your favorite language, but it's not as if you can just do 'from scheduler import magic' and be done. The point is, cron didn't work for you because you wanted sub-minute precision and automatic overlap prevention. For folks who don't need those things, cron is a viable solution. Either way, whether you're writing your own scheduler or writing the scripts to be run out of one, you can use whatever language you like; one of the goals of Couch is to be language-agnostic. As long as you have JSON and HTTP libraries for it, you can even code in Fortran... On Mon, Jul 26, 2010 at 5:10 PM, Sivan Greenberg wrot= e: > Hi Nils, > > I am using Python to have 2 separate background process that: > 1) Replication connections are working/ restart/ fix if needed > (including wrapper SSH tunnels). > 2) Conflict resolution that is triggered by the _changes feed, > asynchronous and parallelized. > > I've also used CouchDBKit to manage CouchDB from Python. > > Doing the response/fix logic in a cron triggered script proved > problematic for me, so I went and added my own scheduling bits, on the > way enabling sub-minute precision quite easily, attributing to the fun > and ease of Python. (Scheduling being mostly while loops with > configurable sleep intervals, at its simplest form, and time/date > based sleeps) > > Being able to suspend interval triggered execution until a previous > run came back, without having to use locking or flag files and such as > when using cron, was a breeze. > > I guess that is "different" not better perhaps. > > -Sivan > > On Mon, Jul 26, 2010 at 11:57 PM, Nils Breunese wrot= e: >> Python is a programming language, not a scheduler. (Although I'm sure th= ere are scheduler libraries and things like that for Python.) What do you m= ean by 'works better than cron'? Yes, if you need sub-minute precision you'= ll need to look elsewhere since cron doesn't support that, but otherwise I = wouldn't go and write code to do what a scheduler like cron already provide= s (and it's usually already running anyway). >> >> We're actually using a Python script (using couchdbkit) run by cron for = our CouchDB maintenance needs. >> >> Nils. >> _nn_______________________________________ >> Van: sivang@gmail.com [sivang@gmail.com] namens Sivan Greenberg [sivan@o= mniqueue.com] >> Verzonden: maandag 26 juli 2010 22:26 >> Aan: user@couchdb.apache.org >> Onderwerp: Re: scheduled tasks >> >> I am actually using python to do that in my specific project. Works >> better than cron and allows finer granularity of intervals. >> >> Sivan >> >> 2010/7/26 Nils Breunese : >>> I don't think so. Until there is I guess you could use an external sche= duler like cron? >>> >>> Nils. >>> ________________________________________ >>> Van: Kenneth Tyler [ken@8thfold.com] >>> Verzonden: maandag 26 juli 2010 18:49 >>> Aan: user@couchdb.apache.org >>> Onderwerp: scheduled tasks >>> >>> is there any way to run a scheduled task in couchdb? >>> >>> i'd like to create a bunch of documents that reresent data in records >>> that need to be updated... without having to do the update immediately >>> >>> thanks >>> >>> ken tyler >>> >>> De informatie vervat in deze =C2=A0e-mail en meegezonden bijlagen is ui= tsluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke = informatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of = verstrekking van deze informatie aan derden is voorbehouden aan geadresseer= de. De VPRO staat niet in voor de juiste en volledige overbrenging van de i= nhoud van een verzonden e-mail, noch voor tijdige ontvangst daarvan. >>> >> >> De informatie vervat in deze =C2=A0e-mail en meegezonden bijlagen is uit= sluitend bedoeld voor gebruik door de geadresseerde en kan vertrouwelijke i= nformatie bevatten. Openbaarmaking, vermenigvuldiging, verspreiding en/of v= erstrekking van deze informatie aan derden is voorbehouden aan geadresseerd= e. De VPRO staat niet in voor de juiste en volledige overbrenging van de in= houd van een verzonden e-mail, noch voor tijdige ontvangst daarvan. >> > --=20 Mark J. Reed