### Method

# Camel Session idle_add

since: 3.6

#### Declaration [src]

    guint
    camel_session_idle_add (
      CamelSession* session,
      gint priority,
      GSourceFunc function,
      gpointer data,
      GDestroyNotify notify
    )

#### Description [src]

Adds a function to be called whenever there are no higher priority events pending. If `function` returns `FALSE` it is automatically removed from the list of event sources and will not be called again.

This internally creates a main loop source using `g_idle_source_new()` and attaches it to `session`‘s own `CamelSession:main-context` using g_source_attach().

The `priority` is typically in the range between `G_PRIORITY_DEFAULT_IDLE` and `G_PRIORITY_HIGH_IDLE`.

Available since: 3.6

#### Parameters

`priority`

  Type: `gint`

  The priority of the idle source.

`function`

  Type: `GSourceFunc`

  A function to call.

`data`

  Type: `gpointer`

  Data to pass to `function`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`notify`

  Type: `GDestroyNotify`

  Function to call when the idle is removed, or `NULL`.

#### Return value

Type: `guint`

The ID (greater than 0) of the event source.