This is a simple way to schedule a periodic data source refresh.
Adds a timeout SocketSource to context
and handles all the bookkeeping if
this's refresh enabled state or its refresh
interval_minutes value changes. The callback
is expected
to dispatch an asynchronous job to connect to and fetch updates from a remote server.
The returned ID can be passed to refresh_remove_timeout to remove the
timeout from context
. Note the ID is a private handle and cannot be passed to remove.
this |
an Source |
context |
a MainContext, or |
callback |
function to call on each timeout |
notify |
function to call when the timeout is removed, or |
user_data |
data to pass to |
a refresh timeout ID |