[server] introduce a scheduler class to run repository "looping tasks"
We just use the sched module from the standard library and introduce a tiny
Python2/3 compatibility layer (more for convenience actually). The "looping"
aspect of tasks (previously in LoopTask class) is re-implemeted as a
`schedule_periodic_task` function. This is a reasonably thin layer as compared
to LoopTask/TasksManager classes. Only the "restart" aspect of LoopTask is no
longer present as I'm not sure it's worth keeping.
The advantage of using this (in addition to eventually dropping our custom
code) is that this scheduler class provides a `run` method that blocks the
process while running tasks in its queue. So we can rely on this to have a
'scheduler' ctl command (see forthcoming patch) that would only run "looping
tasks" without having to implement the "blocking" aspect ourself.
Related to #17057223.
3.25 (UNRELEASED)
=================
New features
------------
* A new option `connections-pooler-enabled` (default yes) has been added. This
allow to switch off internal connection pooling for use with others poolers
such as pgbouncer_.
.. _pgbouncer: https://pgbouncer.github.io/
* A new way to declare workflows as simple data structure (dict/list) has been
introduced. Respective utility functions live in ``cubicweb.wfutils``
module. This handles both the creation and migration of workflows.