One tick of Tickator consists of 4 phases.
In this phase are to execution plan added execution requests of ticklets send during previous tick. When requests are added and execution plan is still empty then Tickator will sleep a little while and try again.
All ticklers scheduled in execution plan are executed in parallel. There is no limitation regarding number of ticklets executed in parallel. And there is even no requirement on order of execution - system stay deterministic anyway.
This phase is only phase when is executed code of Ticklet defined by programmer. Programmer of ticklet is allowed to:
Ticklet execution should be as fast as possible. Important parameter of Tickator is number of ticks per second. But one long running execution may easily ruin this parameter because Tickator will not start new tick until all ticklets are executed. Therefore it is recommended to do potentionally long running tasks asynchronously. When done, ticklet may be woke up by requesting execution in next tick and handle result.
Potentionally problematic activities:
In this phase are collected changes to Tickator schema collected in Phase 2 and this changes are applied. Ticklets may be added or removed. And connections may be created or removed.
Phase 3 preceed Phase 4 because it is important that newly created tickator/connection can react on changes generated in current tick.
Execution plan is cleaned and all ticklets depending on changed output ports are added into execution plan.
It is not possible to modify Tickator instance outside of it. You can’t add ticklets, connections, etc. But sometimes it is necessary to inform ticklet about external event. For example date changed, user pressed key, file was read into buffer, etc. For this situation there is possibility to ask for ticklet execution from outside Tickator instance. It can be asked in any time, but it is processed only in Phase 1.