### Method

# Camel Session submit_job

since: 3.2

#### Declaration [src]

    void
    camel_session_submit_job (
      CamelSession* session,
      const gchar* description,
      CamelSessionCallback callback,
      gpointer user_data,
      GDestroyNotify notify
    )

#### Description [src]

This function provides a simple mechanism for providers to initiate low-priority background jobs. Jobs can be submitted from any thread, but execution of the jobs is always as follows:

1) The `CamelSession:job-started` signal is emitted from the thread in which `session` was created. This is typically the same thread that hosts the global default `GMainContext`, or “main” thread.

2) The `callback` function is invoked from a different thread where it’s safe to call synchronous functions.

3) Once `callback` has returned, the `CamelSesson:job-finished` signal is emitted from the same thread as `CamelSession:job-started` was emitted.

4) Finally if a `notify` function was provided, it is invoked and passed `user_data` so that `user_data` can be freed.

Available since: 3.2

#### Parameters

`description`

  Type: `const gchar*`

  Human readable description of the job, shown to a user.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`callback`

  Type: `CamelSessionCallback`

  A `CamelSessionCallback`.

`user_data`

  Type: `gpointer`

  User data passed to the callback.

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

`notify`

  Type: `GDestroyNotify`

  A `GDestroyNotify` function.