incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Chris Anderson <jch...@apache.org>
Subject Re: scheduled tasks
Date Mon, 26 Jul 2010 21:39:38 GMT

On Jul 26, 2010, at 2:28 PM, Mark J. Reed wrote:

> 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...
> 

This is a good way to keep a python program running and reacting to couchdb updates:

http://blog.fupps.com/2010/05/10/update-notifications-in-couchdb-tweeting-urgent-documents/

> 
> On Mon, Jul 26, 2010 at 5:10 PM, Sivan Greenberg <sivan@omniqueue.com> wrote:
>> 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 <N.Breunese@vpro.nl> wrote:
>>> Python is a programming language, not a scheduler. (Although I'm sure there are
scheduler libraries and things like that for Python.) What do you mean 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 provides (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@omniqueue.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 <N.Breunese@vpro.nl>:
>>>> I don't think so. Until there is I guess you could use an external scheduler
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  e-mail en meegezonden bijlagen is uitsluitend
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 geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud
van een verzonden e-mail, noch voor tijdige ontvangst daarvan.
>>>> 
>>> 
>>> De informatie vervat in deze  e-mail en meegezonden bijlagen is uitsluitend 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 geadresseerde. De VPRO staat niet in voor de juiste en volledige overbrenging van de inhoud
van een verzonden e-mail, noch voor tijdige ontvangst daarvan.
>>> 
>> 
> 
> 
> 
> -- 
> Mark J. Reed <markjreed@gmail.com>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message