'Get stream of updates to send to remote servers
Returns:
(int, list[dict]): current stream id and list of updates'

def get_devices_by_remote(self, destination, from_stream_id):

    now_stream_id = self._device_list_id_gen.get_current_token()
    has_changed = self._device_list_federation_stream_cache.has_entity_changed(destination, int(from_stream_id))
    if (not has_changed):
        return (now_stream_id, [])
    return self.runInteraction('get_devices_by_remote', self._get_devices_by_remote_txn, destination, from_stream_id, now_stream_id)
