Comments (9)
The Cron job has the two key components.
- Cron expression parser.
It includes specific time. - Cron job task manager/scheduler.
Should we implement these all components?
from framework.
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.
from framework.
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
from framework.
@lablnet, when I think this deeply, I found the following way to do Cron job package to support cross platform.
- Using the scheduler.php to let this program run on every minute.
- On every minute, we check the specific job should be executed.
- We can use the log file or DB to store every task current execution time.
from framework.
@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}
Both classCron
andSchedule
should have same methods
we can do following inScheduler,php
namespace Zest\Scheduler;
class Scheduler
{
public function __construct()
{
$this->scheduler = php_os() === 'win' ? new Schedule() : new Cron();
}
}
What do you think?
from framework.
from framework.
Sure, so we can start before started actual development it good to write Contracts
First
it let me to starts write schedule.php
part
so you can write Contracts/Interfaces
and pull here => https://github.com/zestframework/Zest_Framework/tree/master/src/Contracts
with sub folder
the interface name should same as class
we can use somthing like
`use \Zest\Contracts\Sitemap\SItemapIndex as SitemapIndexContract``
from framework.
@lablnet, consider following code:
$jobs = [
[new CronExpression('cron job time'), new TaskName()],
[new CronExpression('cron job time'), new TaskName()],
];
$scheduler = new Schedule($jobs);
$scheduler->run();
And let the task
be interface so that we can let developers follow Task
interface to customize the Task
class.
What do you think about that?
from framework.
Yes you are right
but instead of saying CronExpression
it better say TaskExpression
or SchedulerExpression
from framework.
Related Issues (20)
- enhancing the Time class unit tests
- Enhancement of Arrays class HOT 5
- Be flexible for the format inside Time class
- Permission denied after installing Zest framework HOT 6
- Database Package
- Test's for container class
- Enchantment of str class HOT 4
- Error Expection class not found in Redirect.php
- Bug in \Arrays class HOT 10
- Enchantment of \Str class
- SodiumException: key size should be SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes HOT 3
- Wrong Behaviours of Str \hasUpperCase and \hasLowerCase HOT 2
- Cloudcov key is in the travis config HOT 4
- After adding \Site\Key classs tests failing HOT 6
- Enhancement of Whoops Package
- Fix deprecated PSR-4 autoloading
- Tests are failing on Scrutinizer HOT 2
- Package management extends of container
- Adding static code analysis tool support
- 2.0.3 -> 2.0.4 ? HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framework.