Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
can APScheduler work with Pylons 1.0 or Pyramid ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stéphane Klein  
View profile  
 More options Jul 9 2011, 11:35 am
From: Stéphane Klein <steph...@harobed.org>
Date: Sat, 09 Jul 2011 17:35:43 +0200
Local: Sat, Jul 9 2011 11:35 am
Subject: can APScheduler work with Pylons 1.0 or Pyramid ?
Hi,

I wounder if Advanced Python Scheduler (APScheduler) -
http://readthedocs.org/docs/apscheduler/en/latest/ can work with Pyramid
and Pylons 1.0 ?

Thanks for your comments.

Regards,
Stephane
--
St phane Klein <steph...@harobed.org>
blog: http://stephane-klein.info
Twitter: http://twitter.com/klein_stephane
pro: http://www.is-webdesign.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karol Tomala  
View profile  
 More options Jul 9 2011, 9:43 pm
From: Karol Tomala <ktom...@gmail.com>
Date: Sun, 10 Jul 2011 03:43:30 +0200
Local: Sat, Jul 9 2011 9:43 pm
Subject: Re: can APScheduler work with Pylons 1.0 or Pyramid ?
W dniu 09.07.2011 17:35, St phane Klein pisze:
> Hi,

> I wounder if Advanced Python Scheduler (APScheduler) -
> http://readthedocs.org/docs/apscheduler/en/latest/ can work with
> Pyramid and Pylons 1.0 ?

> Thanks for your comments.

> Regards,
> Stephane

Hi.
Sure it can. I've done this for my own web applications. The way you
want to do it is either construct another thread (probably by the means
of a function launched in config/environment.py load_environment()) and
then proceed with most of the tasks you want to schedule, or like I did
it myself, write script detached from the web application (i.e. make_app
function launched by Paster entry point) and then utilize process to
launch your script as a daemon. Writing separate script running as a
daemon won't impact performance of the web app itself in case if you are
up to some resource intensive tasks (which I assume you do).

Best regards,
Karol Tomala


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stéphane Klein  
View profile  
 More options Jun 16 2012, 4:52 am
From: Stéphane Klein <klein.steph...@gmail.com>
Date: Sat, 16 Jun 2012 01:52:37 -0700 (PDT)
Local: Sat, Jun 16 2012 4:52 am
Subject: Re: can APScheduler work with Pylons 1.0 or Pyramid ?

The way you

> Writing separate script running as a
> daemon won't impact performance of the web app itself in case if you are
> up to some resource intensive tasks (which I assume you do).

In this source code, do you think daemon can impact performance of the web
app ?
It's is a bad idea to start scheduler in my webapp ?

Is there an issue with Global Internal Lock of Python ?

from apscheduler.scheduler import Scheduler
import requests

sched = Scheduler()

@sched.interval_schedule(seconds=10)
def some_job():
    print('start')
    for a in range(1, 10):
        r = requests.get('http://www.google.fr')
        print(r.status_code)

    print('fin')

sched.configure()
sched.start()

from wsgiref.util import setup_testing_defaults
from wsgiref.simple_server import make_server

def simple_app(environ, start_response):
    setup_testing_defaults(environ)

    status = '200 OK'
    headers = [('Content-type', 'text/plain')]

    start_response(status, headers)

    ret = ["%s: %s\n" % (key, value)
           for key, value in environ.iteritems()]
    return ret

httpd = make_server('', 8000, simple_app)
print "Serving on port 8000..."
httpd.serve_forever()


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Parnell Springmeyer  
View profile  
 More options Jun 17 2012, 1:19 pm
From: Parnell Springmeyer <ixma...@gmail.com>
Date: Sun, 17 Jun 2012 12:19:57 -0500
Local: Sun, Jun 17 2012 1:19 pm
Subject: Re: can APScheduler work with Pylons 1.0 or Pyramid ?

I can't answer your question specifically (someone else may have to do that), but I will say this: cron is the natural "scheduler" on a system and if you're doing anything that's supposed to be in the background or "scheduled" it's nice to put it on cron. Easier to find for other programmers, universal scheduling system, etc…

Additionally, you could use Celery to do work. Schedule a start script as a cronjob and put whatever kind of job you want work to be done for into Celery.

That's how I do it at least.

On Jun 16, 2012, at 3:52 AM, Stéphane Klein wrote:

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Holth  
View profile  
 More options Jun 18 2012, 10:07 am
From: Daniel Holth <dho...@gmail.com>
Date: Mon, 18 Jun 2012 07:07:39 -0700 (PDT)
Local: Mon, Jun 18 2012 10:07 am
Subject: Re: can APScheduler work with Pylons 1.0 or Pyramid ?

APScheduler is great. I like my applications to be self-contained and
system independent. So, personally I avoid cron jobs. For a simple
single-process webapp it's fine to start out with a scheduler thread. When
your application gets more complex you could run APScheduler in a
separately managed process such as, if you are using uwsgi, a uwsgi mule.

Your example code will probably spend most of its time waiting for I/O, not
holding the GIL.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »