You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks good, but we don't want to let developer set less than one minute
on cron job.
I think it is fine to use the following code you mention.
Muhammad Umer Farooq <notifications@github.com> 於 2019年3月24日 週日 下午5:43 寫道:
@peter279k <https://github.com/peter279k> Yes but this approach has few
drawbacks
*Using the scheduler.php to let this program run on every minute*
First if any developer want to set schedule to set for 30 seconds then
what result expected?
Also i think this make framework slightly slower
How can we execute scheduler.php on every mints, without task scheduler
or cron?
The approach i think
there should be four files
- AbstractScheduler.php => expression parser
- Cron.php => Crons commands {extend AbstractScheduler}
- Schedule.php => Task Scheduler {extend AbstractScheduler}
- Scheduler.php => Scheduler which use {Cron or Schedule}
we can do following in Scheduler,php
namespace Zest\Scheduler;class Scheduler{ public function __construct() { $this->scheduler = php_os() === 'win' ? new Schedule() : new Cron(); }}
What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#154 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AImpMwJAPY4En_l_cg-3xQJoHe7gBDQoks5vZ0i4gaJpZM4bdx3m>
.
Activity
peter279k commentedon Mar 23, 2019
The Cron job has the two key components.
It includes specific time.
Should we implement these all components?
peter279k commentedon Mar 23, 2019
You also mention about the cross platform.
I am not familiar with the cron job task on Windows.
I also am familiar with cron job on Linux.
lablnet commentedon Mar 23, 2019
Yes should implemented all components.
in windows there is Task Scheduler
when you send your proposal as a pull request i will add Win task scheduler support
write in such a way it has option to add support for windows
peter279k commentedon Mar 24, 2019
@lablnet, when I think this deeply, I found the following way to do Cron job package to support cross platform.
lablnet commentedon Mar 24, 2019
@peter279k Yes but this approach has few drawbacks
Using the scheduler.php to let this program run on every minute
First if any developer want to set schedule to set for 30 seconds then what result expected?
Also i think this make framework slightly slower
How can we execute
scheduler.phpon every mints, without task scheduler or cron?The approach i think
there should be four files
AbstractScheduler.php=>expression parserCron.php=>Crons commands {extend AbstractScheduler}Schedule.php=>Task Scheduler {extend AbstractScheduler}Scheduler.php=> Scheduler which use{Cron or Schedule}Both class
CronandScheduleshould have same methodswe can do following in
Scheduler,phpWhat do you think?
peter279k commentedon Mar 24, 2019
lablnet commentedon Mar 24, 2019
Sure, so we can start before started actual development it good to write
ContractsFirstit let me to starts write
schedule.phppartso you can write
Contracts/Interfacesand pull here => https://github.com/zestframework/Zest_Framework/tree/master/src/Contractswith sub folder
the interface name should same as class
we can use somthing like
`use \Zest\Contracts\Sitemap\SItemapIndex as SitemapIndexContract``
peter279k commentedon Mar 24, 2019
@lablnet, consider following code:
And let the
taskbe interface so that we can let developers followTaskinterface to customize theTaskclass.What do you think about that?
lablnet commentedon Mar 24, 2019
Yes you are right
but instead of saying
CronExpressionit better sayTaskExpressionorSchedulerExpressionfix for #154