CM.Client.set_sync_callback

### Method

# CM Clientset_sync_callback

#### Declaration [src]

    void
    cm_client_set_sync_callback (
      CmClient* self,
      CmCallback callback,
      gpointer user_data,
      GDestroyNotify destroy_data
    )

#### Description [src]

Set the sync callback which shall be executed for the events happening in `self`. Set this early after creating the client so any async operations syncing the client state with the server can invoke it already.

Passing `NULL` for the callback removes an existing callback.

#### Parameters

`callback`

  Type: `CmCallback`

  A `CmCallback`.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  The user data passed to `callback`.

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

`destroy_data`

  Type: `GDestroyNotify`

  Function to call when the callback is removed.

  The argument can be `NULL`.