def fetch(self, callback):
<EOL>session = self.client.sync.start(self.device_uuid)<EOL>if session is None or '<STR_LIT:id>' not in session:<EOL><INDENT>return<EOL><DEDENT>while True:<EOL><INDENT>queue_items = self.client.sync.fetch(self.device_uuid, session['<STR_LIT:id>'])<EOL>if not queue_items:<EOL><INDENT>break<EOL><DEDENT>ack_keys = []<EOL>for item in queue_items:<EOL><INDENT>if callback(item['<STR_LIT>'], item['<STR_LIT:data>']):<EOL><INDENT>ack_keys.append(item['<STR_LIT>']['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT><DEDENT>if ack_keys:<EOL><INDENT>self.client.sync.ack(self.device_uuid, ack_keys)<EOL><DEDENT><DEDENT>
Perform a full synchronization flow.

.. code-block:: python
    :linenos:

    >>> client = basecrm.Client(access_token='<YOUR_PERSONAL_ACCESS_TOKEN>')
    >>> sync = basecrm.Sync(client=client, device_uuid='<YOUR_DEVICES_UUID>')
    >>> sync.fetch(lambda meta, data: basecrm.Sync.ACK)

:param callback: Callback that will be called for every item in a queue.
    Takes two input arguments: synchronization meta data and assodicated data.
    It must return either ack or nack.