Gang,
To keep you informed, Qi4j Scheduler implementation is going well. I'm writing
it externally before importing code in qi4j-librar...@develop so the code
history will be simple. I hope to be able to do it this weekend or next week. I
would like to explain you the way I made it to gather comments, remarks and
needs.
For now the scheduler use cron expressions (extended to seconds) and support
persistent and volatile schedules.
It use two entities, Schedule and Task. There is no directly usable TaskEntity
for now but code is provided so that you can write your taks with something
like:
@Mixins(FooTaskMixin.class)
interface FooTaskEntity extends Task, EntityComposite {}
class FooTaskMixin implements TaskBehavior { void run() {...} }
That way you can add state specific to your task and implement the behavior
with
the code you want to be run when the task is run.
The SchedulerService use a pulse-thread with a configurable rhythm that enqueue
tasks in a thread pool (size is configurable too).
As the Task is an entity, it's run() method is run in a UoW. When thinking
about
tasks that need to run code in several subsequents UoW (ie. for batching
purpose) I thought about chaining tasks but it feels a little bit hackish.
Could
a Task pause the current UoW (which is handling Task state), handle "nested"
UoWs and then resume the said UoW ?
WDYT about all this ?
/Paul
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev