Re: [web2py] Re: Scheduler and far-away tasks

2018-06-11 Thread Joe Barnhart
Hi Richard --

I heartily recommend you take another look at the scheduler old friend. 
 Once you wrap your mind around it, the things it can do will simply amaze 
you.  There are a few key principles you need to grok first, and I still 
struggle a bit here and there.

As far as knowing the result of a scheduled task, the scheduler shines 
there.  It persists in the database every failed run of the scheduler, so 
you can easily find the details in the tables if your critical task ran or 
failed.  There is also a timing granularity to mind -- the scheduler does 
everything on a fixed heartbeat which defaults to around 5 seconds.  In my 
case, it doesn't matter if a swim meet becomes visible 5 seconds late or 
not.  But in some cases, pinpoint timing is called for.  In those cases, 
the scheduler heartbeat can be tightened.

I can't say enough about the scheduler.  Yes, it adds a layer of 
complication to the site, but it also has the ability to simplify things 
mightily.  Like this swim meet catalog I described to Anthony.  Yes, I 
could do it other ways but OMG this makes it so simple and the rules can be 
arbitrarily complex.  I can imagine a team saying they want their best 
swimmers to get access before their worst -- the idea is easily extended to 
any level of granularity down to individual swimmers if necessary.

-- Joe

On Monday, June 11, 2018 at 11:30:30 AM UTC-7, Richard wrote:
>
> Hello Joe,
>
> I am not using the scheduler primarilly because I never had time to 
> implemented it. But I miss so much all the things you mention... Let says 
> just configure a task to lock a user account on a specific date in the 
> future when you have employee termination in advance and you have no other 
> proper mean to recall that and don't want to pollute your calendar with a 
> bunch of todo thing...
>
> The only flaw I see is relying on the tool and having some task not 
> performed as expect for some reason and not get properly inform that a 
> given task didn't succeed as expect... Depending of the criticallity of the 
> task this may have bad consequences...
>
> Richard
>
> On Mon, Jun 11, 2018 at 11:16 AM, Anthony 
> > wrote:
>
>> I suppose that should be fine. Tasks are stored in a database, so should 
>> be as durable as any other data you are storing.
>>
>> Alternatively, you might consider storing the reveal date with the item 
>> and running a regular task that simply selects all items with reveal dates 
>> equal to or earlier than the current day and updates those items to become 
>> visible. Or even just add a common filter that automatically filters out 
>> any records with a future reveal date.
>>
>> Anthony
>>
>>
>> On Sunday, June 10, 2018 at 7:20:19 PM UTC-4, Joe Barnhart wrote:
>>>
>>> Are there any reasons I should not schedule tasks days, weeks, or months 
>>> in advance in the web2py scheduler?  It seems such a fantastic, 
>>> general-purpose tool that I'm using it for more and more things in the 
>>> site.  
>>>
>>> Currently I'm considering using it to "reveal" embargo'ed items that 
>>> should not be seen until a certain date and time.  The reveal would involve 
>>> putting a task in the scheduler for the far-away date and having it create 
>>> a permission on a table at the moment of truth.
>>>
>>> Is there some reason this might be considered bad design, or poor use of 
>>> the scheduler?  Reliability is of high importance in my site, so design 
>>> that decreases reliability is to be avoided.
>>>
>>> -- Joe
>>>
>>> -- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Scheduler and far-away tasks

2018-06-11 Thread Joe Barnhart
Hi Anthony --

I thought the DB would provide enough persistence.  My task model is, as 
you might expect, a little more complicated than the simple scenario I 
described.  In my case the catalog of swim meets are only viewable by 
specific subsets of people at given times. My product is a reservation in a 
swim meet, and only certain teams are able to see the meet.  On top of 
that, the host of the meet wants to reveal the meet to certain teams in a 
certain order, to allow a favored team to get as many swimmers in the meet 
as they want before a less-favored team has a chance to register.

So the catalog visibility is controlled by the web2py permissions 
structure, where swimmers belong to a team group and those groups get a 
permission link to "read" a line in the catalog table.  Controlling when 
these permission links are created and destroyed would be under the 
scheduler.  Believe it or not, on the old site this is all manual 
operation.  There are swim meet hosts who stay up until midnight to control 
their meet's visibility now.

-- Joe

On Monday, June 11, 2018 at 8:16:04 AM UTC-7, Anthony wrote:
>
> I suppose that should be fine. Tasks are stored in a database, so should 
> be as durable as any other data you are storing.
>
> Alternatively, you might consider storing the reveal date with the item 
> and running a regular task that simply selects all items with reveal dates 
> equal to or earlier than the current day and updates those items to become 
> visible. Or even just add a common filter that automatically filters out 
> any records with a future reveal date.
>
> Anthony
>
> On Sunday, June 10, 2018 at 7:20:19 PM UTC-4, Joe Barnhart wrote:
>>
>> Are there any reasons I should not schedule tasks days, weeks, or months 
>> in advance in the web2py scheduler?  It seems such a fantastic, 
>> general-purpose tool that I'm using it for more and more things in the 
>> site.  
>>
>> Currently I'm considering using it to "reveal" embargo'ed items that 
>> should not be seen until a certain date and time.  The reveal would involve 
>> putting a task in the scheduler for the far-away date and having it create 
>> a permission on a table at the moment of truth.
>>
>> Is there some reason this might be considered bad design, or poor use of 
>> the scheduler?  Reliability is of high importance in my site, so design 
>> that decreases reliability is to be avoided.
>>
>> -- Joe
>>
>>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Scheduler and far-away tasks

2018-06-11 Thread Richard Vézina
Hello Joe,

I am not using the scheduler primarilly because I never had time to
implemented it. But I miss so much all the things you mention... Let says
just configure a task to lock a user account on a specific date in the
future when you have employee termination in advance and you have no other
proper mean to recall that and don't want to pollute your calendar with a
bunch of todo thing...

The only flaw I see is relying on the tool and having some task not
performed as expect for some reason and not get properly inform that a
given task didn't succeed as expect... Depending of the criticallity of the
task this may have bad consequences...

Richard

On Mon, Jun 11, 2018 at 11:16 AM, Anthony  wrote:

> I suppose that should be fine. Tasks are stored in a database, so should
> be as durable as any other data you are storing.
>
> Alternatively, you might consider storing the reveal date with the item
> and running a regular task that simply selects all items with reveal dates
> equal to or earlier than the current day and updates those items to become
> visible. Or even just add a common filter that automatically filters out
> any records with a future reveal date.
>
> Anthony
>
>
> On Sunday, June 10, 2018 at 7:20:19 PM UTC-4, Joe Barnhart wrote:
>>
>> Are there any reasons I should not schedule tasks days, weeks, or months
>> in advance in the web2py scheduler?  It seems such a fantastic,
>> general-purpose tool that I'm using it for more and more things in the
>> site.
>>
>> Currently I'm considering using it to "reveal" embargo'ed items that
>> should not be seen until a certain date and time.  The reveal would involve
>> putting a task in the scheduler for the far-away date and having it create
>> a permission on a table at the moment of truth.
>>
>> Is there some reason this might be considered bad design, or poor use of
>> the scheduler?  Reliability is of high importance in my site, so design
>> that decreases reliability is to be avoided.
>>
>> -- Joe
>>
>> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Scheduler and far-away tasks

2018-06-11 Thread Anthony
I suppose that should be fine. Tasks are stored in a database, so should be 
as durable as any other data you are storing.

Alternatively, you might consider storing the reveal date with the item and 
running a regular task that simply selects all items with reveal dates 
equal to or earlier than the current day and updates those items to become 
visible. Or even just add a common filter that automatically filters out 
any records with a future reveal date.

Anthony

On Sunday, June 10, 2018 at 7:20:19 PM UTC-4, Joe Barnhart wrote:
>
> Are there any reasons I should not schedule tasks days, weeks, or months 
> in advance in the web2py scheduler?  It seems such a fantastic, 
> general-purpose tool that I'm using it for more and more things in the 
> site.  
>
> Currently I'm considering using it to "reveal" embargo'ed items that 
> should not be seen until a certain date and time.  The reveal would involve 
> putting a task in the scheduler for the far-away date and having it create 
> a permission on a table at the moment of truth.
>
> Is there some reason this might be considered bad design, or poor use of 
> the scheduler?  Reliability is of high importance in my site, so design 
> that decreases reliability is to be avoided.
>
> -- Joe
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.