I just found a case where I needed to use #synchronize. I have a helper method which looks for an element on the page and if it exists it clicks on it and returns some text that gets updated on the page (via JavaScript). There are cases where between finding the element and clicking on it, it might disappear (and possibly re-appear) due to other JavaScript code and could raise a Selenium::WebDriver::Error::StaleElementReferenceError exception. So I use synchronize like this:
page.document.synchronize do
element = first('#whatever')
if element
element.click
find('#foo').text
else
nil
end
end