Let us improve the main loop, for better cache handling of expiration.
Originally, the task was described as follows:
-------------------------------
In gpg-agent, currently, we have handle_tick function.
It is basically for monitoring some events.
In T3829, handle_tick also handles passphrase cache expiration.
In GnuPG 2.2, it was used for watching scdaemon process. In GnuPG 2.4 and later, it is now done by a thread.
For passphrase cache expiration, the way of handle_tick is not ideal:
- the timing for an action at expire is not that exact (depends on the interval)
- it may be too often to be more exact
I'd like to propose introducing agent_timer_* internal API, to address this issue. Something like:
- agent_timer_create
- agent_timer_settime
- agent_timer_delete
... so that gpg-agent can run only when needed, somehow exact and can sleep on select when no events or requests.