[web2py] Re: Having a function always running in the background

2020-09-09 Thread Dave S


On Tuesday, September 1, 2020 at 11:48:34 AM UTC-7, Jim S wrote:
>
> Ah, so this sounds a little different than what I thought you were after.
>
> Looks like you want to run a task at a regularly scheduled time, not based 
> on something that you've triggered in your application.
>
> Given that information, I'd turn to the scheduler on my host system.  Are 
> you running Linux then I'd just create a cron job.  Windows - add it to the 
> windows scheduler (they still have that on windows server, right?)
>
 
Tasks and the Windows scheduler are a pain, IMO.  The web2py scheduler can 
handle regularly schedule times, and the later versions have a way setting 
a scheduled task with a cron-like  description.

I use the web2py scheduler to run tasks at regular times, including 
cleaning sessions and reporting uploads.  I also use a plain old atq to run 
a psql script to make a weekly report, but I use the web2py scheduler to 
look for the report output file and mail it to my target users.

Having figured out the scheduler myself, I think it's pretty easy, and most 
of what you need is in Chapter 3 (The Core).  One of the helpful hints that 
Simone (Niphlod) cued me in on is my contribution to "Deployment".

http://web2py.com/books/default/chapter/29/04/the-core#web2py-Scheduler>
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Initial-Queuing-of-a-Repeating-Task>

[On the other hand, I was also shocked by someone on StackOverflow saying 
it was hard to use libcurl)



Then I would go here ->  
> http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options
>
> to learn how to craft a command that would call my script to determine who 
> to send emails to, and then send them.
>
> Does that help?
>
> (or, please correct me if my understanding of your problem is still off)
>
> -Jim
>
>
/dps
 

> On Tuesday, September 1, 2020 at 11:59:02 AM UTC-5, mostwanted wrote:
>>
>> Hey Jim, I'm failing to understand the scheduler, please if its not a 
>> bother simplify it for me. In my script below I wanna send users who host 
>> stuff on my site emails when their subscription is left with 7 days to 
>> expire. Ideally twice a week for these 7 days. I'm hosting my app with 
>> pythonanywhere. How do i put it together?
>>
>> *CODE*:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *import datetimedef email_reminder():
>> dt=db(db.house_owner).select()for dt in dt:
>> now_dt=dt.expiry_date-request.now.date()
>> now_dt2=now_dt.daysnew_con=dt.controller+1if 
>> now_dt2 <= 7:mail.send(to=dt.email_address,subject="House 
>> Hosting Reminder",message ='Hello %s %s, \nThis is a reminder that your 
>> house listing with our service will expire in %d days. \nTo increase your 
>> suscription time or for further details please contact us at the given 
>> details.\n\nBest regards;' % (dt.Name, dt.Surname, now_dt2))
>> db(db.house_owner.controller).update(controller=new_con)*
>>
>> *Regards;  *
>>
>> On Tuesday, September 1, 2020 at 4:02:42 PM UTC+2 Jim S wrote:
>>
>>> The web2py scheduler pretty much is a background task that runs 
>>> unnoticed.  
>>>
>>> I use it in a number of places to queue hundreds or thousands of 
>>> outbound emails.  I like the scheduler because it then also servers as a 
>>> log of the emails that were sent.
>>>
>>> If that isn't what you're looking for then how about celery or 
>>> redis-queue?  But, they are a bother because then you have more services 
>>> you need to grok, start up and manage.  The web2py scheduler takes care of 
>>> all of that for you.  Let me know if you want to see a sample of how we 
>>> handle it.
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:


 Is there a way to have a function always running without having to use 
 a scheduler?
 I have a function that i want to always send emails based on its 
 arguments & conditions but i want it to run in the background unnoticed 
 like a worker but not run by a scheduler, is this possible? I hope my 
 question is clear.

 Regards;

 Mostwanted 

>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/47e78a4b-903f-4903-94ec-308c89d4fdd8o%40googlegroups.com.


Re: [web2py] Re: Having a function always running in the background

2020-09-03 Thread António Ramos
maybe this online cron can help.

https://www.easycron.com/

Em qui., 3 de set. de 2020 às 02:31, Andy W 
escreveu:

> If you are using PythonAnywhere, they have Scheduled Tasks and (for paid
> accounts) an Aways-on Task.
> These are very simple to use. I use them for managing the queue of
> outgoing emails.
>
> Andy
>
> On Wednesday, September 2, 2020 at 5:09:15 PM UTC+10 mostwanted wrote:
>
>> You are on point Jim, you get what i'm trying to achieve, let me see if i
>> can put it together.
>>
>> Regards;
>>
>> On Tuesday, September 1, 2020 at 8:48:34 PM UTC+2 Jim S wrote:
>>
>>> Ah, so this sounds a little different than what I thought you were after.
>>>
>>> Looks like you want to run a task at a regularly scheduled time, not
>>> based on something that you've triggered in your application.
>>>
>>> Given that information, I'd turn to the scheduler on my host system.
>>> Are you running Linux then I'd just create a cron job.  Windows - add it to
>>> the windows scheduler (they still have that on windows server, right?)
>>>
>>> Then I would go here ->
>>> http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options
>>>
>>> to learn how to craft a command that would call my script to determine
>>> who to send emails to, and then send them.
>>>
>>> Does that help?
>>>
>>> (or, please correct me if my understanding of your problem is still off)
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, September 1, 2020 at 11:59:02 AM UTC-5, mostwanted wrote:

 Hey Jim, I'm failing to understand the scheduler, please if its not a
 bother simplify it for me. In my script below I wanna send users who host
 stuff on my site emails when their subscription is left with 7 days to
 expire. Ideally twice a week for these 7 days. I'm hosting my app with
 pythonanywhere. How do i put it together?

 *CODE*:









 *import datetimedef email_reminder():
 dt=db(db.house_owner).select()for dt in dt:
 now_dt=dt.expiry_date-request.now.date()
 now_dt2=now_dt.daysnew_con=dt.controller+1if
 now_dt2 <= 7:mail.send(to=dt.email_address,subject="House
 Hosting Reminder",message ='Hello %s %s, \nThis is a reminder that your
 house listing with our service will expire in %d days. \nTo increase your
 suscription time or for further details please contact us at the given
 details.\n\nBest regards;' % (dt.Name, dt.Surname, now_dt2))
 db(db.house_owner.controller).update(controller=new_con)*

 *Regards;  *

 On Tuesday, September 1, 2020 at 4:02:42 PM UTC+2 Jim S wrote:

> The web2py scheduler pretty much is a background task that runs
> unnoticed.
>
> I use it in a number of places to queue hundreds or thousands of
> outbound emails.  I like the scheduler because it then also servers as a
> log of the emails that were sent.
>
> If that isn't what you're looking for then how about celery or
> redis-queue?  But, they are a bother because then you have more services
> you need to grok, start up and manage.  The web2py scheduler takes care of
> all of that for you.  Let me know if you want to see a sample of how we
> handle it.
>
> -Jim
>
>
> On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:
>>
>>
>> Is there a way to have a function always running without having to
>> use a scheduler?
>> I have a function that i want to always send emails based on its
>> arguments & conditions but i want it to run in the background unnoticed
>> like a worker but not run by a scheduler, is this possible? I hope my
>> question is clear.
>>
>> Regards;
>>
>> Mostwanted
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/b09e640c-fd89-4d03-803a-53b5f9e91df2n%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

[web2py] Re: Having a function always running in the background

2020-09-02 Thread Andy W
If you are using PythonAnywhere, they have Scheduled Tasks and (for paid 
accounts) an Aways-on Task. 
These are very simple to use. I use them for managing the queue of outgoing 
emails.

Andy

On Wednesday, September 2, 2020 at 5:09:15 PM UTC+10 mostwanted wrote:

> You are on point Jim, you get what i'm trying to achieve, let me see if i 
> can put it together.
>
> Regards;
>
> On Tuesday, September 1, 2020 at 8:48:34 PM UTC+2 Jim S wrote:
>
>> Ah, so this sounds a little different than what I thought you were after.
>>
>> Looks like you want to run a task at a regularly scheduled time, not 
>> based on something that you've triggered in your application.
>>
>> Given that information, I'd turn to the scheduler on my host system.  Are 
>> you running Linux then I'd just create a cron job.  Windows - add it to the 
>> windows scheduler (they still have that on windows server, right?)
>>
>> Then I would go here ->  
>> http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options
>>
>> to learn how to craft a command that would call my script to determine 
>> who to send emails to, and then send them.
>>
>> Does that help?
>>
>> (or, please correct me if my understanding of your problem is still off)
>>
>> -Jim
>>
>>
>> On Tuesday, September 1, 2020 at 11:59:02 AM UTC-5, mostwanted wrote:
>>>
>>> Hey Jim, I'm failing to understand the scheduler, please if its not a 
>>> bother simplify it for me. In my script below I wanna send users who host 
>>> stuff on my site emails when their subscription is left with 7 days to 
>>> expire. Ideally twice a week for these 7 days. I'm hosting my app with 
>>> pythonanywhere. How do i put it together?
>>>
>>> *CODE*:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *import datetimedef email_reminder():
>>> dt=db(db.house_owner).select()for dt in dt:
>>> now_dt=dt.expiry_date-request.now.date()
>>> now_dt2=now_dt.daysnew_con=dt.controller+1if 
>>> now_dt2 <= 7:mail.send(to=dt.email_address,subject="House 
>>> Hosting Reminder",message ='Hello %s %s, \nThis is a reminder that your 
>>> house listing with our service will expire in %d days. \nTo increase your 
>>> suscription time or for further details please contact us at the given 
>>> details.\n\nBest regards;' % (dt.Name, dt.Surname, now_dt2))
>>> db(db.house_owner.controller).update(controller=new_con)*
>>>
>>> *Regards;  *
>>>
>>> On Tuesday, September 1, 2020 at 4:02:42 PM UTC+2 Jim S wrote:
>>>
 The web2py scheduler pretty much is a background task that runs 
 unnoticed.  

 I use it in a number of places to queue hundreds or thousands of 
 outbound emails.  I like the scheduler because it then also servers as a 
 log of the emails that were sent.

 If that isn't what you're looking for then how about celery or 
 redis-queue?  But, they are a bother because then you have more services 
 you need to grok, start up and manage.  The web2py scheduler takes care of 
 all of that for you.  Let me know if you want to see a sample of how we 
 handle it.

 -Jim


 On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:
>
>
> Is there a way to have a function always running without having to use 
> a scheduler?
> I have a function that i want to always send emails based on its 
> arguments & conditions but i want it to run in the background unnoticed 
> like a worker but not run by a scheduler, is this possible? I hope my 
> question is clear.
>
> Regards;
>
> Mostwanted 
>


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b09e640c-fd89-4d03-803a-53b5f9e91df2n%40googlegroups.com.


[web2py] Re: Having a function always running in the background

2020-09-02 Thread mostwanted
You are on point Jim, you get what i'm trying to achieve, let me see if i 
can put it together.

Regards;

On Tuesday, September 1, 2020 at 8:48:34 PM UTC+2 Jim S wrote:

> Ah, so this sounds a little different than what I thought you were after.
>
> Looks like you want to run a task at a regularly scheduled time, not based 
> on something that you've triggered in your application.
>
> Given that information, I'd turn to the scheduler on my host system.  Are 
> you running Linux then I'd just create a cron job.  Windows - add it to the 
> windows scheduler (they still have that on windows server, right?)
>
> Then I would go here ->  
> http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options
>
> to learn how to craft a command that would call my script to determine who 
> to send emails to, and then send them.
>
> Does that help?
>
> (or, please correct me if my understanding of your problem is still off)
>
> -Jim
>
>
> On Tuesday, September 1, 2020 at 11:59:02 AM UTC-5, mostwanted wrote:
>>
>> Hey Jim, I'm failing to understand the scheduler, please if its not a 
>> bother simplify it for me. In my script below I wanna send users who host 
>> stuff on my site emails when their subscription is left with 7 days to 
>> expire. Ideally twice a week for these 7 days. I'm hosting my app with 
>> pythonanywhere. How do i put it together?
>>
>> *CODE*:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *import datetimedef email_reminder():
>> dt=db(db.house_owner).select()for dt in dt:
>> now_dt=dt.expiry_date-request.now.date()
>> now_dt2=now_dt.daysnew_con=dt.controller+1if 
>> now_dt2 <= 7:mail.send(to=dt.email_address,subject="House 
>> Hosting Reminder",message ='Hello %s %s, \nThis is a reminder that your 
>> house listing with our service will expire in %d days. \nTo increase your 
>> suscription time or for further details please contact us at the given 
>> details.\n\nBest regards;' % (dt.Name, dt.Surname, now_dt2))
>> db(db.house_owner.controller).update(controller=new_con)*
>>
>> *Regards;  *
>>
>> On Tuesday, September 1, 2020 at 4:02:42 PM UTC+2 Jim S wrote:
>>
>>> The web2py scheduler pretty much is a background task that runs 
>>> unnoticed.  
>>>
>>> I use it in a number of places to queue hundreds or thousands of 
>>> outbound emails.  I like the scheduler because it then also servers as a 
>>> log of the emails that were sent.
>>>
>>> If that isn't what you're looking for then how about celery or 
>>> redis-queue?  But, they are a bother because then you have more services 
>>> you need to grok, start up and manage.  The web2py scheduler takes care of 
>>> all of that for you.  Let me know if you want to see a sample of how we 
>>> handle it.
>>>
>>> -Jim
>>>
>>>
>>> On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:


 Is there a way to have a function always running without having to use 
 a scheduler?
 I have a function that i want to always send emails based on its 
 arguments & conditions but i want it to run in the background unnoticed 
 like a worker but not run by a scheduler, is this possible? I hope my 
 question is clear.

 Regards;

 Mostwanted 

>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/063eaa9f-f85f-4569-95ab-17d60f5b966fn%40googlegroups.com.


[web2py] Re: Having a function always running in the background

2020-09-01 Thread Jim S
Ah, so this sounds a little different than what I thought you were after.

Looks like you want to run a task at a regularly scheduled time, not based 
on something that you've triggered in your application.

Given that information, I'd turn to the scheduler on my host system.  Are 
you running Linux then I'd just create a cron job.  Windows - add it to the 
windows scheduler (they still have that on windows server, right?)

Then I would go here 
->  http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options

to learn how to craft a command that would call my script to determine who 
to send emails to, and then send them.

Does that help?

(or, please correct me if my understanding of your problem is still off)

-Jim

On Tuesday, September 1, 2020 at 11:59:02 AM UTC-5, mostwanted wrote:
>
> Hey Jim, I'm failing to understand the scheduler, please if its not a 
> bother simplify it for me. In my script below I wanna send users who host 
> stuff on my site emails when their subscription is left with 7 days to 
> expire. Ideally twice a week for these 7 days. I'm hosting my app with 
> pythonanywhere. How do i put it together?
>
> *CODE*:
>
>
>
>
>
>
>
>
>
> *import datetimedef email_reminder():dt=db(db.house_owner).select()
> for dt in dt:
> now_dt=dt.expiry_date-request.now.date()
> now_dt2=now_dt.daysnew_con=dt.controller+1if 
> now_dt2 <= 7:mail.send(to=dt.email_address,subject="House 
> Hosting Reminder",message ='Hello %s %s, \nThis is a reminder that your 
> house listing with our service will expire in %d days. \nTo increase your 
> suscription time or for further details please contact us at the given 
> details.\n\nBest regards;' % (dt.Name, dt.Surname, now_dt2))
> db(db.house_owner.controller).update(controller=new_con)*
>
> *Regards;  *
>
> On Tuesday, September 1, 2020 at 4:02:42 PM UTC+2 Jim S wrote:
>
>> The web2py scheduler pretty much is a background task that runs 
>> unnoticed.  
>>
>> I use it in a number of places to queue hundreds or thousands of outbound 
>> emails.  I like the scheduler because it then also servers as a log of the 
>> emails that were sent.
>>
>> If that isn't what you're looking for then how about celery or 
>> redis-queue?  But, they are a bother because then you have more services 
>> you need to grok, start up and manage.  The web2py scheduler takes care of 
>> all of that for you.  Let me know if you want to see a sample of how we 
>> handle it.
>>
>> -Jim
>>
>>
>> On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:
>>>
>>>
>>> Is there a way to have a function always running without having to use a 
>>> scheduler?
>>> I have a function that i want to always send emails based on its 
>>> arguments & conditions but i want it to run in the background unnoticed 
>>> like a worker but not run by a scheduler, is this possible? I hope my 
>>> question is clear.
>>>
>>> Regards;
>>>
>>> Mostwanted 
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/68a6713f-d1cf-44d3-9c6a-a076fa6c430bo%40googlegroups.com.


[web2py] Re: Having a function always running in the background

2020-09-01 Thread mostwanted
Hey Clemens, the reason i'm running away from the scheduler honestly is 
because i dont understand it but i've asked Jim to show me how, your 
solution sounds very neat, if i still dont get the scheduler after Jim i'm 
reaching out to you.

Regards;

On Tuesday, September 1, 2020 at 3:50:59 PM UTC+2 Clemens wrote:

> Hi, I've done this via LOAD and ajax in an target div to have a graph 
> always be updated if the user changes the model to be visualized. If the 
> user changes the model, I trigger an update by an jquery reload. The data 
> is exchanged via session and of course via the database. If you have no 
> output in the DIV, the user won't see anything about your mailer.
>
> Could this be an solution for you? If yes, do you know what to do or do 
> you need more detailed information?
>
> Regards
> Clemens
>
> On Tuesday, September 1, 2020 at 3:41:27 PM UTC+2 mostwanted wrote:
>
>>
>> Is there a way to have a function always running without having to use a 
>> scheduler?
>> I have a function that i want to always send emails based on its 
>> arguments & conditions but i want it to run in the background unnoticed 
>> like a worker but not run by a scheduler, is this possible? I hope my 
>> question is clear.
>>
>> Regards;
>>
>> Mostwanted 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fc661500-1d0b-480d-b05f-18724c9eea56n%40googlegroups.com.


[web2py] Re: Having a function always running in the background

2020-09-01 Thread mostwanted
Hey Jim, I'm failing to understand the scheduler, please if its not a 
bother simplify it for me. In my script below I wanna send users who host 
stuff on my site emails when their subscription is left with 7 days to 
expire. Ideally twice a week for these 7 days. I'm hosting my app with 
pythonanywhere. How do i put it together?

*CODE*:









*import datetimedef email_reminder():dt=db(db.house_owner).select()
for dt in dt:
now_dt=dt.expiry_date-request.now.date()
now_dt2=now_dt.daysnew_con=dt.controller+1if 
now_dt2 <= 7:mail.send(to=dt.email_address,subject="House 
Hosting Reminder",message ='Hello %s %s, \nThis is a reminder that your 
house listing with our service will expire in %d days. \nTo increase your 
suscription time or for further details please contact us at the given 
details.\n\nBest regards;' % (dt.Name, dt.Surname, now_dt2))
db(db.house_owner.controller).update(controller=new_con)*

*Regards;  *

On Tuesday, September 1, 2020 at 4:02:42 PM UTC+2 Jim S wrote:

> The web2py scheduler pretty much is a background task that runs 
> unnoticed.  
>
> I use it in a number of places to queue hundreds or thousands of outbound 
> emails.  I like the scheduler because it then also servers as a log of the 
> emails that were sent.
>
> If that isn't what you're looking for then how about celery or 
> redis-queue?  But, they are a bother because then you have more services 
> you need to grok, start up and manage.  The web2py scheduler takes care of 
> all of that for you.  Let me know if you want to see a sample of how we 
> handle it.
>
> -Jim
>
>
> On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:
>>
>>
>> Is there a way to have a function always running without having to use a 
>> scheduler?
>> I have a function that i want to always send emails based on its 
>> arguments & conditions but i want it to run in the background unnoticed 
>> like a worker but not run by a scheduler, is this possible? I hope my 
>> question is clear.
>>
>> Regards;
>>
>> Mostwanted 
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7830407c-0f70-4196-9c64-e66eeb76c3f7n%40googlegroups.com.


[web2py] Re: Having a function always running in the background

2020-09-01 Thread Jim S
The web2py scheduler pretty much is a background task that runs unnoticed.  

I use it in a number of places to queue hundreds or thousands of outbound 
emails.  I like the scheduler because it then also servers as a log of the 
emails that were sent.

If that isn't what you're looking for then how about celery or 
redis-queue?  But, they are a bother because then you have more services 
you need to grok, start up and manage.  The web2py scheduler takes care of 
all of that for you.  Let me know if you want to see a sample of how we 
handle it.

-Jim


On Tuesday, September 1, 2020 at 8:41:27 AM UTC-5, mostwanted wrote:
>
>
> Is there a way to have a function always running without having to use a 
> scheduler?
> I have a function that i want to always send emails based on its arguments 
> & conditions but i want it to run in the background unnoticed like a worker 
> but not run by a scheduler, is this possible? I hope my question is clear.
>
> Regards;
>
> Mostwanted 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/abc89e10-422b-4a14-9c5c-9b4dd756beeao%40googlegroups.com.


[web2py] Re: Having a function always running in the background

2020-09-01 Thread Clemens
Hi, I've done this via LOAD and ajax in an target div to have a graph 
always be updated if the user changes the model to be visualized. If the 
user changes the model, I trigger an update by an jquery reload. The data 
is exchanged via session and of course via the database. If you have no 
output in the DIV, the user won't see anything about your mailer.

Could this be an solution for you? If yes, do you know what to do or do you 
need more detailed information?

Regards
Clemens

On Tuesday, September 1, 2020 at 3:41:27 PM UTC+2 mostwanted wrote:

>
> Is there a way to have a function always running without having to use a 
> scheduler?
> I have a function that i want to always send emails based on its arguments 
> & conditions but i want it to run in the background unnoticed like a worker 
> but not run by a scheduler, is this possible? I hope my question is clear.
>
> Regards;
>
> Mostwanted 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/15ece892-5e5e-400f-a676-a3c14f0e424en%40googlegroups.com.